<!doctype html>
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
<script src="script.js"></script>
<style>
ul {
list-style:none;
}
</style>
</head>
<body>
<div ng-controller="Ctrl">
<ul>
<li>[<a href ng-click="people.push({})">Add</a>]</li>
<li ng-repeat="person in people">
<input ng-model="person.name">
[<a href ng-click="people.splice($index, 1)">X</a>]
</li>
</ul>
<ul>
<li ng-show="people[0]">
Person 1:<input type="text" ng-model="people[0].name" />
</li>
<li ng-show="people[1]">
Person 2:<input type="text" ng-model="people[1].name" /><br/>
</li>
</ul>
Number of People: {{people.length}}<br/>
<!--- Example with simple pluralization rules for en locale --->
Without Offset:
<ng-pluralize count="people.length"
when="{'0': 'Nobody is viewing.',
'one': '1 person is viewing.',
'other': '{} people are viewing.'}">
</ng-pluralize><br>
<!--- Example with offset --->
With Offset(2):
<ng-pluralize count="people.length" offset=2
when="{'0': 'Nobody is viewing.',
'1': '{{people[0].name}} is viewing.',
'2': '{{people[0].name}} and {{people[1].name}} are viewing.',
'one': '{{people[0].name}}, {{people[1].name}} and one other person are viewing.',
'other': '{{people[0].name}}, {{people[1].name}} and {} other people are viewing.'}">
</ng-pluralize>
</div>
</body>
</html>
function Ctrl($scope) {
$scope.people = [];
$scope.people.push({name:'Igor'});
$scope.people.push({name:'Misko'});
}