Created
August 13, 2015 16:07
-
-
Save CarlLee/453412e15e5f97f8f417 to your computer and use it in GitHub Desktop.
Angular.js example
This file contains hidden or 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
angular.module('app', []) | |
.controller('ItemsCtrl', function($scope, $http){ | |
$scope = $http.get('items.json').success(function(data){ | |
$scope.items = data; | |
}); | |
}); |
This file contains hidden or 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
<html> | |
<head> | |
<script src='angular.js'/> | |
<script src='app.js'/> | |
</head> | |
<body ng-app='app'> | |
<div ng-controller='ItemsCtrl'> | |
<ul ng-repeat='item in items'> | |
<li>{{ item.name }}: {{ item.price }}</li> | |
</ul> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment