javascript - Find out if radio option is checked before it was clicked -
i have following radio group.
<input type="radio" name="group1" ng-checked="true" ng-model="group1" id="name1" value="one"> <input type="radio" name="group1" ng-checked="false" ng-model="group1" id="name2" value="two"> <input type="radio" name="group1" ng-checked="false" ng-model="group1" id="name3" value="three"> when radio input clicked, want able figure out if, before clicked, if active or not.
for example, if clicked on #name1, respond true because checked.
if clicked on #name3, respond false because #name1 selected. if click on #name3 again, return true.
could me this?
you can watch code in controller. now, whenever model changed(in ui or in controller), event raised.
$scope.$watch('group1', function (newvalue, oldvalue) { //place code here ... // have access old , new value }); just information, try use @ least watches can...
Comments
Post a Comment