In Angular (1.3), I want to be able to enter a dob
field of my person
object and this has another property called age
which calculates the age based on the dob
.
So I have the field to enter dob
as:
<div class="form-group">
<input class="form-control" type="date" ng-model="player.dob" placeholder="DD/MM/YYYY" />
</div>
and I display some of the information that the user types, as they type (name, sex, description etc) but when the user enters the dob
, I want to automatically display age
like this:
<div>{{player.age}}</div>
How can I do that?
Thanks