Prev Demo
AngularJS
>
List From JSON Collection
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> </head> <body> <script> var members = [ { username: 'SheoNarayan', address: 'Hyderabad' }, { username: 'Munna', address: 'Bokaro' }, { username: 'Jay', address: 'Aurangabad' }, { username: 'Sreeni', address: 'New York' } ]; var app = angular.module("app", []); app.controller("MemberController", ["$scope", function ($scope) { $scope.Members = members; }]); </script> <div ng-app="app"> <h4>Listing item from the collection</h4> <div ng-controller="MemberController"> <ul> <li ng-repeat="member in Members"> {{$index + 1}}. Name: {{member.username }} | Address: {{ member.address}} </li> </ul> </div> </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output