angular-bootstrap-switch
angular-bootstrap-switch copied to clipboard
null and undefined not supported in ngTrueValue/ngFalseValue
Angular bootstrap switch controller.$render explicitly sets indeterminate state when newValue is undefined or null.
That's usually fine, except when using something like...
ng-true-value="'foobar'" ng-false-value="undefined", and actually setting the model to undefined.
In that situation, bootstrap-switch should be false, not indeterminate.
EDIT: talking about a checkbox.
The best test case is probably...
ng-true-value="undefined" ng-false-value="null"
Because true value being set to undefined will fail sooner, as getTrueValue will assume the value was not set and should be true instead of undefined.