Prev Demo
AngularJS
>
Listing From Array
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> <h4>Looping array</h4> <script> var usernames = ['Sheo', 'Narayan', 'Dutta']; var app = angular.module("app", []); app.controller("ArrayController", ["$scope", function ($scope) { $scope.Usernames = usernames; }]); </script> <div ng-app="app" ng-controller="ArrayController"> <ul> <li ng-repeat="username in Usernames">{{username}}</li> </ul> </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output