JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.3.js"></script>
<script type="text/x-handlebars">
Works but is within a view that wraps the entire template. This is expected: {{foo beer}}
<hr />
Raw unbound helper doesn't work: {{unbound beer}}
<hr />
Working unbound helper: {{view App.unboundView}}
<hr />
Works w/o extra markup around value and within a child view of the wrapping view holding the entire template: {{view App.myView}}
<hr />
Same as above but w/ different tag: {{view App.myView2}}
</script>
JavaScript
App = Ember.Application.create();
Ember.Handlebars.registerHelper('foo', function(key) {
return (key + ' bar');
});
App.unboundView = Ember.View.extend({
template: Ember.Handlebars.compile(
'{{unbound beer}}'
),
beer: 'unboundView text'
});
App.myView = Ember.View.extend({
template: Ember.Handlebars.compile(
'<div id="first">{{foo "so extra stuff in this div"}}</div>'
)
});
App.myView2 = Ember.View.extend({
tagName: 'a',
attributeBindings: ['href'],
href: '#',
template: Ember.Handlebars.compile(
'{{foo "text inside anchor tag"}}'
)
});