Closed wesley3523 closed 9 years ago
quick example of how angular-material is doing this: https://material.angularjs.org/#/api/material.components.switch/directive/mdSwitch
Set a watch on your model and make set the values in your controller.
$scope.watch('switchModel', function(val) {
if(val) {
$scope.otherValue = 'a';
} else {
$scope.othervalue = 'b';
}
})
Is it possible to get other value than true or false? for example
[ng-true-value=""] [ng-false-value=""]