Open lbertin opened 9 years ago
If you want to use ngTrueValue/ngFalseValue then part ''ng-click="' + attrs.ngModel + '=!' + attrs.ngModel" is not valid as it assumes true/false.
Replace this with the following code and will work:
ng-click="' + attrs.ngModel + '= ' + attrs.ngModel + '=== ' + (attrs.ngTrueValue || true) + '? ' + (attrs.ngFalseValue || false) + ' : ' + ( attrs.ngTrueValue || true) +
you can try this: https://github.com/hjzheng/angular-switch
Hi,
As in the pure following angular example
Using following html code
I tried to evolve the directive by implementing ngTrueValue & ngFalseValue as follow (just after the "[...]attrs.ngModel[...]", around line 20 in angular-ui-switch.js)
It did not work...:( Any clue ? help ? advice ?
Bellow, the full directive
Regards Lionel