<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<!-- the ngApp tag is in the body -->
<div ng-controller="testController">
I have changed nothing other than the url in your code. It works - so if it doesn't work on yours. Perhaps you should check your code again
<ul>
<li ng-repeat="data in names">
{{ data.name + ', ' + data.email }}
</li>
</ul>
</div>
JavaScript
angular.module('testApp.services', []);
angular.module('testApp.directives', []);
angular.module('testApp.controllers', ['testApp.services', 'testApp.directives']);
angular.module('testApp', ['testApp.services', 'testApp.controllers', 'testApp.directives']);
/*
* To declare a directive
* angular.module('testApp.controllers').directive('testDirective', function() { return {}; });
*
* To declare a service
* angular.module('testApp.services').factory('testService', function() { return {}; });
*/
//
angular.module('testApp.controllers').controller('testController', ['$scope', '$http', function ($scope, $http) {
$scope.name = 'CodeHawkz';
$scope.names = [];
$http.get('http://jsonplaceholder.typicode.com/users').then(function (result) {
$scope.names =result.data;
});
}]);
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!