I'm doing the AngularJS tutorial, and I simply can't get the following to work, even though the code is exactly like the one in the tutorial -
controller.js-
var phoneApp = angular.module('phoneApp', []);
phoneApp.controller('PhoneCtrl', function ($scope, $http) {
$http.get('https://github.com/angular/angular-phonecat/blob/master/app/phones/phones.json').success(function(data) {
$scope.phones = data;
});
$scope.orderProp = 'age';
});
HTML -
<!DOCTYPE html>
<html lang="en" ng-app="phoneApp">
<script src="http://code.angularjs.org/1.2.14/angular.min.js"></script>
<script src="controller.js"></script>
<body ng-controller="PhoneCtrl">
Search: <input ng-model="query" >
<select ng-model="orderProp">
<option value="name">Alphabetical</option>
<option value="age">Newest</option>
</select>
<ul >
<li ng-repeat="phone in phones | filter:query | orderBy:orderProp">
{{phone.name}}
<p>{{phone.snippet}}</p>
<p>{{phone.foo}}</p>
</li>
</ul>
</body>
</html>
This does nothing, I can't see the data from the JSON file
Could somebody please point out what I'm missing? Thanks!