angular-bootstrap-switch icon indicating copy to clipboard operation
angular-bootstrap-switch copied to clipboard

null and undefined not supported in ngTrueValue/ngFalseValue

Open himdel opened this issue 6 years ago • 1 comments

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.

himdel avatar May 02 '19 17:05 himdel

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.

himdel avatar May 02 '19 17:05 himdel