<http://stackoverflow.com/questions/30567804/unable-to-update-controller-model-value-from-custom-directive-with-controller-as/30568993#>
I am facing problem to update my model values from custom directive using
controller as syntax. I can clearly see that through console.log that the
values are getting changed in the directive however they are not getting
updated in the controller. <h4>{{self.tabs}} </h4> always shows same
values.
In addition I want to do watch on controller (self --> tabs) model to add
'active class' but when I try to use watch it is throwing me out error. So
I have commented that part. The following is the watch related code, which
is not working:
$scope.$watch('tabsCtrlself.tabs.index', function() {
if (tabsCtrlself.tabs.index === index) {
angular.element($element).addClass('active');
}
});
Please find my plunker <http://plnkr.co/edit/fN6tuOrIUNXSYXiIFVO4?p=preview>,
Can any one direct me to fix this?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.