Skip to content

Instantly share code, notes, and snippets.

@arangates
Created October 23, 2016 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arangates/0ba462a0a14b3cf987025148d908e773 to your computer and use it in GitHub Desktop.
Save arangates/0ba462a0a14b3cf987025148d908e773 to your computer and use it in GitHub Desktop.
http_angular.html
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<!-- <p>{{orders}}</p> -->
<ul>
<li ng-repeat="order in orders.result track by $index">
{{order.orderId}} , {{order.customerCode}} ,{{order.orderDateTime}} ,
<div ng-repeat="i in order.item_details" >
{{i.productcode}}-{{i.orderQty}}
</div>
<!-- {{order.item_details[0].productcode}} -->
</li>
<ul>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$http
.get("https://gist.githubusercontent.com/arangates/1416896f746c9d48a622ee9eb167852a/raw/501f7be1f6d8ab6ab820ae55e8c0902be7c7b763/orders.json")
.then(function(response) {
$scope.orders = response.data;
console.log(response);
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment