Ng-Bind-5

 

We have an array named flowersArray as $scope.flowersArray = ["Rose", "Sun Flower", "Merry Gold", "Lily", "Bluebell", "Bergamot", "Bellflower", "Begonia", "Aster"] and with the help of ng-repeat directive we bind this array to the span element which display the list of the flower names given in array. The output will be as: Sun Flower Merry Gold Lily Bluebell Bergamot Bellflower Begonia Aster

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app="myApp"> <div ng-controller="myController"> <div ng-repeat="flower in flowersArray"> <span ng-bind="flower"></span> <br /> </div> </div> <script> var app = angular.module("myApp", []); app.controller('myController', ['$scope', function ($scope) { $scope.flowersArray = ["Rose", "Sun Flower", "Merry Gold", "Lily", "Bluebell", "Bergamot", "Bellflower", "Begonia", "Aster"] }]); </script> </body> </html>
Output