Closed Suresh-Lakum closed 6 years ago
Hi Suresh,
As a replacement for ng-change
, have you tried watching the value of the model?
For example:
<script type="text/javascript">
var app = angular.module('myApp',['ngComboDatePicker']);
app.controller('basicCtrl', function ($scope) {
$scope.basic = new Date();
$scope.$watch('basic', function(newValue, oldValue) {
if(newValue !== oldValue) {
console.log('The date was changed!');
}
});
});
</script>
<div ng-app="myApp" ng-controller="basicCtrl">
<p>Choose a date: <ng-combo-date-picker ng-model="basic"></ng-combo-date-picker></p>
</div>
Regards
Hi,
Yes that's the wise solution. But consider scenario where I have collection of objects and among them I have one date field, I have to iterate through objects and then add watch to it. Which is I think not a best practice. So in that case if I have ngChange event or ngBlur event it will be good.
Hopefully you got my point.
Kind regards, Suresh
Hi Suresh,
I have just made release 1.6.0 implementing the ng-change
attribute.
Please, let me know if it works as expected.
Regards
Thanks.
Hello,
I am struggling with ng-change. It will be great if we have ng-change for ngComboDatePicker. Much appreciated.
Kind Regards.