私は次のコードを持っています。私は年齢を更新するために使用しているcalculateAge(birthdate)という関数も持っています。どのようにするかわからないのは、人が生年月日の入力を更新し、年齢を更新するときに、この関数を入力から呼び出すことです。どんな助けも素晴らしいだろう。呼び出し関数と入力からのビューの更新
おかげで、
<fieldset ng-model="mySeat.seat" class="col-xs-12 session-registrant" ng-repeat="seat in seats | filter:cartPerf.perf_no">
<div class="session-registrant-field field-date" ng-if="mySeat.seat.ask_birthdate == 'Y'">
<label for="birthdate-{{$ + cartPerf.perf_no + "mySeat.seat.customer_no}}">
{{bdayLbl}}
<span class="error-msg" ng-show="registrantForm.$submitted || registrantForm['birthdate-' + cartPerf.perf_no + mySeat.seat.customer_no].$touched">
<span ng-show="registrantForm['birthdate-' + cartPerf.perf_no + mySeat.seat.customer_no].$error.required">(Required)</span>
<span ng-show="registrantForm['birthdate-' + cartPerf.perf_no + mySeat.seat.customer_no].$error.date">(Invalid birthdate)</span>
</span>
</label>
<div ng-bind="mySeat.seat.age"></div>
<input
type="date"
name="birthdate-{{$ + cartPerf.perf_no + mySeat.seat.customer_no}}"
id=""
value="{{mySeat.seat.birthdate | formatDate: mySeat.seat.birthdate:'yyyy-MM-dd' || ''}}"
ng-model="mySeat.seat.birthdate"
ng-required="mySeat.seat.bdatereq == 'Y'">
</div>
</fieldset>