angularjs - Angular equivalent of Radio Button Change Event -


in jquery like:

$( ".radio-buttons" ).change(function() {  .. }); 

how same in angular js

there 2 ways monitor radio button changes ,

first use ng-change along radio button,

</label><input type="radio" ng-model="radiovalue" ng-change="invokechangefunction()" />yes</label> 

in controller ,

$scope.invokechangefunction = function() {    console.log($scope.value); } 

second method using $watch ng-model,

$scope.$watch('radiovalue', function(value) {        console.log(value);  }); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -