Upon visiting a page, I encounter the following code:
<div ng-if='$stateParams.show=="previous"'>
From
<input type="text" ng-model="year_from" />
<br/>
To
<input type="text" ng-model="year_to" />
</div>
In my controller script, I have the following setup:
module.exports = function(){
$scope.year_from = '2014';
$scope.$watch( 'year_from', function(v) {
console.log(v);
console.log('from');
$scope.get_previous_reports();
});
}
However, I notice that the variable v is only defined as 2014 once and the string 'from' is logged once, without the other function being called. What could be causing this issue?