有没有办法获得angularjs材料日历日期选择的事件
我试图实现一个日历,在日历上选择日期时,我希望触发一个事件并获取控件。我只能选择日期,无法获取该事件。 我试着去图书馆找上面的日历, 在这里,我看到一个事件正在被发射,我怎样才能听到这个事件?md日历更改有没有办法获得angularjs材料日历日期选择的事件,angularjs,angularjs-material,Angularjs,Angularjs Material,我试图实现一个日历,在日历上选择日期时,我希望触发一个事件并获取控件。我只能选择日期,无法获取该事件。 我试着去图书馆找上面的日历, 在这里,我看到一个事件正在被发射,我怎样才能听到这个事件?md日历更改 /** * Sets the ng-model value for the calendar and emits a change event(md-calendar-change). * @param {Date} date */ CalendarCtrl.pro
/**
* Sets the ng-model value for the calendar and emits a change event(md-calendar-change).
* @param {Date} date
*/
CalendarCtrl.prototype.setNgModelValue = function(date) {
var value = this.dateUtil.createDateAtMidnight(date);
this.focus(value);
this.$scope.$emit('md-calendar-change', value);
this.ngModelCtrl.$setViewValue(value);
this.ngModelCtrl.$render();
return value;
};
对日期选择作出反应的最佳方法是使用
ng change
指令:
<md-calendar ng-model="birthday" ng-change="onSelect(birthday)">
</md-calendar>
有关详细信息,请参阅