现在我试图在用户更改日期之后做某事.但似乎我忽略了ng的变化.这是我的代码示例:
<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" /> in my controller: $scope.changedate=function(){ console.log($scope.startdate); }
任何想法?
当$范围更改时,您可以关注.
原文链接:https://www.f2er.com/angularjs/142583.html这样的事情
$scope.startdate; $scope.$watch("startdate",function(newValue,oldValue) { console.log("I've changed : ",startdate); });