Prev Demo
AngularJS
>
Templates
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', function($scope) { $scope.Members = members; }); </script> </head> <body ng-app="app"> <p>AngularJS basic template</p> <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> </body> </body> </html>
Note: We DO NOT save your trial code in our database.
Output