Hy to all
I try to create helper
Handlebars.registerHelper('testCan', function(permissionName, options){
var permission = Ember.Object.extend({
testCan: function(){
debugger;
return true;
}.property()
}).create();
// wipe out contexts so boundIf uses `this` (the permission) as the context
options.contexts = null;
Ember.Handlebars.helpers.boundIf.call(permission, "testCan", options)
});
And use it as
{{#testCan read controller=controller}}
<h1>It's works</h1>
{{/testCan}}
I do this to test pattern from here http://livsey.org/blog/2012/10/16/writing-a-helper-to-check-permissions-in-ember-dot-js/
But it doesn't work ((
What's wrong? Ember version - 1.9.1
P.P.S originally i work with existing code ( see here Ember.handlebars boundIf didn't call calculated property ) But this example i've got on trying reproduce / resolve that problem