<input name="birthday"
type="text"
value="{{vm.client.birthday | date:'dd.MM.yyyy'}}"
ng-click="vm.selectDate()"
readonly
required/>
function selectDate() {
$cordovaDatePicker.show({
mode: 'date',
date: new Date(),
minDate: new Date(1900, 1, 1),
maxDate: new Date(new Date().getFullYear() - 6, 1, 1)
}).then(function(date) {
vm.client.birthday = date;
$scope.$apply();
});
}
Datepicker shows, then callback calls, but value="{{vm.client.birthday | date:'dd.MM.yyyy'}}" doesn't update.
答案 0 :(得分:2)
在输入标记内使用ng-model / ng-value,而不是值属性。