Created
October 23, 2016 06:37
-
-
Save arangates/0ba462a0a14b3cf987025148d908e773 to your computer and use it in GitHub Desktop.
http_angular.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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