servergrove / NgSwitchery

An AngularJS Directive for Switchery
MIT License
87 stars 49 forks source link

ng-switchery not updating ng-model value on toggle the switch in angular js #44

Open JatinDudhat opened 6 years ago

JatinDudhat commented 6 years ago

I have used the switch in angular js like <input type="checkbox" id="is_default" class="js-switch" ng-model="vm.is_default" ui-switch/> It is updating the value if default value=0 and i change it to 1 It's not updating the model value when default value =1 and i change it to 0(it's not updating the value of vm.is_default)

atefBB commented 5 years ago

Hey @JatinDudhat! Did you try to add ng-true-value and ng-false-value attributes to checkbox? Or maybe using ng-value attribute?