mercredi 4 février 2015

How do I make a conditional helper with ember-cli and handlebars 2.0.0?

I am trying to achieve something similar to the form of:



{{#if has-permission "my_permission"}}
// do some stuff here
{{else}}
// fallback
{{/if}}


OR



{{#hasPermission session.user.permissions "my_permission"}}


I cannot figure this out. I've read this but there isn't much explaining on anything other than helpers that render content or alter it e.g. {{render "something"}}


When I try to make it a conditional I get this:



registerBoundHelper-generated helpers do not support use with Handlebars blocks.


Any help greatly appreciated, thanks!


PS Im using ember 1.9.1, latest data and handlebars 2.0





Aucun commentaire:

Enregistrer un commentaire