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
Post a Comment