My dropdown selection is updating the variable in my controller, but the watch directive is not being triggered.
<select ng-model="storesid" ng-change="changeVal(storesid)" ng-options="store.name for store in stores">
<option value="">
</option>
</select>
In my controller:
app.controller("segmentCtrl",function($scope,$rootScope,segmentService,lookupService){
$scope.changeVal = function(item){
$scope.timeSeries = item;
}
})
I also have a directive:
In the directive, I am trying to watch for changes:
.directive('timeseries1',function(){
return{
restrict:'E',
scope:{
val:'='
},
link:function(scope,element,attrs){
scope.$watch('timeSeries',function(){
})
}
}
})
<div ng-controller="segmentCtrl">
<timeseries1 id="dualAxisAreaContainer4" val="timeSeries" ></timeseries1>
</div>