<!DOCTYPE html>
<
html
>
<
head
>
<
title
>ng-pluralize Directive</
title
>
<
script
src
=
</
script
>
</
head
>
<
body
ng-app
=
"app"
style
=
"text-align:center"
>
<
h1
style
=
"color:green;"
>GeeksforGeeks</
h1
>
<
h2
style
=
""
>ng-pluralize Directive</
h2
>
<
div
ng-controller
=
"geek"
>
<
p
>Input Names separated by comma(, ):</
p
>
<
textarea
class
=
"form-control"
ng-model
=
"people"
ng-list
=
", "
>
</
textarea
><
br
><
br
>
<
ng-pluralize
count
=
"people.length"
offset
=
"2"
when="{
'0': 'You got no viewers.',
'1': '{{people[0]}} is viewing.',
'2': '{{people[0]}} and {{people[1]}} are viewing.',
'one': '{{people[0]}}, {{people[1]}} and one other
person is viewing.',
'other': '{{people[0]}}, {{people[1]}} and {}
other people are viewing.'}">
</
ng-pluralize
>
</
div
>
<
script
>
var app = angular.module("app", []);
app.controller('geek', ['$scope', function($scope) {
$scope.people = [];
}]);
</
script
>
</
body
>
</
html
>