如何捕获引导日期选择器更改事件? [英] How to catch the bootstrap datepicker change event?
本文介绍了如何捕获引导日期选择器更改事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在,我正在尝试在用户更改日期后执行某些操作.但是似乎我的ng-change
被忽略了.
Now I am trying to do something after user change the date. But seems like my ng-change
is ignored.
这是我的代码示例:
<input ng-change='changedate()'
type="text"
starting-day="2"
show-button-bar="false"
show-weeks="false"
class="form-control addTicketDateInput"
datepicker-popup="dd MMM"
ng-model="startdate"
is-open="openstart"
datepicker-options="dateOptions"
ng-required="true"
close-text="Close" />
在我的控制器中:
$scope.changedate=function(){
console.log($scope.startdate);
}
有什么主意吗?
推荐答案
您可以随时注意$scope
的更改时间.
You could keep an eye on when the $scope
changed.
类似这样的东西:
$scope.startdate;
$scope.$watch("startdate", function(newValue, oldValue) {
console.log("I've changed : ", startdate);
});
这篇关于如何捕获引导日期选择器更改事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文