I have the following code which binds and displays date of the due_date.
Actually I'm trying to bind the Due_date
value into another input ng-module
as another
, so I have used the below given HTML coding.
My HTML:
<p><input type="text" data-ng-model="another" ng-bind="another=addDays(sryarndebitnote.invoice_date, sryarndebitnote.terms) | date:'dd-MM-yyyy'"></p>
My controller:
$scope.addDays = function(stringDate, days) {
var date = new Date(stringDate);
date.setDate(date.getDate() + parseInt(days));
return date;
}
When I run the above code, I get the following error:
Error: Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["fn: ngModelWatch; newVal: \"2016-08-22T00:00:00.000Z\";
I have created Plunker for reference: My plunker
Ideas of why I'm getting this error?