Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorial</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script> </head> <body> <div ng-app="myApp" ng-controller="pluralizeCtrl"> <h3>ng-pluralize Directive in AngularJS Tutorial</h3> <ul> <li ng-pluralize ng-repeat="x in names" offset=1 count="x" when="{'0': 'Nobody is viewing.', '1': '{{x}} is viewing.', '2': '1 and 2 are viewing.', 'other': '1 and {} other people are viewing.'}"> </li> </ul> </div> <script> var app = angular.module('myApp', []); app.controller('pluralizeCtrl', function($scope) { $scope.names=[1,2,3,4,5,6,7,8,9]; }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.