javascript - Call Angular-function upon $scope-variable change -


i new angularjs , trying set function gets called upon whenever variable changed.

currently have dropdown-menu, ng-model bound $scope.userrating. , trying function gets called when user changes value using dropdown.

i have been looking @ $watch, not quite sure on how work. tried make ng-click function on in html, ng-clicks don't seem trigger.

you should use $watch . example-

 $scope.$watch('modalvarible',function(newval,oldval){ //do code } 

here on change of variable 'modalvarible' watch called.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -