Closed jelhan closed 8 years ago
Re-opening to confirm this will work for you. Take a look at the recent commit f9e9925ee29cc5447cbfd1b1c58c4de87e663613 Let me know what you think.
Idea looks good, but there's a bug.
Ember.assert('Object must have a .toString() method!', !value.toString);
// !"string".toString = false
// !(new String("string")).toString = false
Ember.assert throws an exception if condition is not met. So it should be the other way round. But I would suggest to test that toString is a function.
Ember.assert('Object must have a .toString() method!', typeof value.toString === 'function');
https://github.com/jelhan/ember-bootstrap-switch/commit/32c8a65fc87f49db7135f296f448ede7bde66ae8
Works for me, care to submit a PR? I'll release after that.
Released as 1.13.1, thanks for your help.
Currently SafeString objects is not supported as
labelText
property. That's annoying if you use an intl library which returns SafeString objects. Could use get helper as a work-a-round but native support would be nicer. Should be safe to just calltoString
onlabelText
property.