Solution
I made a bunch of assumptions because there wasn't enough information from you question. Please tailor this to your needs. In this example, I've created an array of objects that contains a name and a dob. Since age will be calculated, I've used the html5 field output.
Essentially, what you need to do is create a function that calculates the age. Since you are storing dob, it's unnecessary to store age. Age should be a calculated field based off of dob. Since UTC time is from 1970, calculation of age should be (today - dob).getFullYear() - 1970. See below.
This avoids the multiple id problem that you face. With AngularJS, you should always think data first. Manipulation of the DOM should be a last resort. I suspect you were calculating the age based off of the id's.
Here is the jsFiddle.
Code
Here is my AngularJS Template:
<div ng-app="app" ng-controller="ctrl">
<div ng-repeat="person in data">
<input type="text" ng-model="person.name" />
<input type="date" ng-model="person.dob" />
<input type="output" value="{{ getAge(person.dob) }}" />
</div>
</div>
Here is my Controller, along with the helper functions.
var app = angular.module('app', []);
var ctrl = function($scope) {
/* Replace data with your resource/service call */
$scope.data = [
{name: 'Fred',
dob: randDate()},
{name: 'Bob',
dob: randDate()},
{name: 'Julie',
dob: randDate()}
];
/* Calculates the age */
$scope.getAge = function(dob) {
var now = new Date();
var age = dateDiff(now, new Date(dob));
return age.getFullYear() - 1970;
};
};
function dateDiff(date1, date2) {
return new Date(Math.abs(date1.getTime() - date2.getTime()));
}
/* Creates a random date in ISO format */
function randDate(){
var now = new Date();
var date = new Date(Math.random() *
Date.UTC(now.getFullYear(),
now.getMonth(),
now.getDate()));
return date.toISOString().substring(0, 10);
}