angular-switcher
angular-switcher copied to clipboard
ng-change function's newValue/oldValue don't respect true-value/false-value attributes
Create a switcher with true-value, false-value, and ng-change
e.g.
<switcher ng-model="switchertype"
ng-change="onSwitcherChange(newValue, oldValue)"
true-label="Public"
true-value="'public'"
false-label="Private"
false-value="'private'"
></switcher>
Clicking on the toggle itself, sets the newValue and oldValue to "public" or "private", as expected. But clicking on the labels, the newValue and oldValue become either true or false.