Home > front end >  How to change the default click event behavior of inputs in AngularJS?
How to change the default click event behavior of inputs in AngularJS?

Time:02-17

Using AngularJS and i have a radio box which retrieves the list from Database on selected.

<input type="radio" id="activeMeetingRadio"   ng-model="my.model" value="Active" ng-change="call to backend">

Once i select this radio my list is fetched and radio seems clicked, now after submit the forms,i sets the form as pristine and reset the checked value of radio to blank like below which makes the radio as unchecked.

my.model='';

but the issue is, even if i click the radio again, no event gets fired until i click another radio and then click back to this radio. Seems like a default bahaviour of AngularJS form controls. Is there any way i can make this radio fire event?

CodePudding user response:

I was able to resolve this by setting the value in controller scope and then reset it using my.model='' will reset the value.

  • Related