Is there possibility in handlebars to do something like
{{input type="radio" checked=model.isAdmin}}Admin
{{input type="radio" checked=model.isGuest}}Guest
property of model, model.isAdmin
return true
or false
.
Because handlebars version is 1.3.0.
answer on this question doesn't help me!
Actually that pretty easy using closure actions:
<input type="radio" name="isAdmin" checked=isAdmin onclick={{action (mut isAdmin) true}} />
<input type="radio" name="isAdmin" checked={{not isAdmin}} onclick={{action (mut isAdmin) false}} />
Well, if I understood you correctly isGuest
means not admin.
However if its something different, its a very flexible approach, so you probably can do what you want.
However to mention is the not
helper I'm using. For this you should check out ember-truth-helpers.
Here is a working twiddle with this solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With