Closed H1D closed 10 years ago
Here is example with original ember-cloaking
http://jsbin.com/ACikukuCA/11/edit
And forked version http://jsbin.com/ACikukuCA/14/edit
the only difference is that original have this line: contextBinding: 'content'
.
It seems to work in your jsbin, but when I try this patch on Discourse it refuses to work. Here's one of the errors, which is weird:
@eviltrout maybe because Discourse designed so that it's expects content
? But Ember itself using context
: http://emberjs.jsbin.com/AtEXixOb/2/edit
I think it's better for Ember plugin to follow Ember's own style
Hi,
For me, ember-cloaking does not work without this patch.
According to Ember documentation:
By default,
Ember.View
will look for a function in thetemplate
property and invoke it with the value ofcontext
. The value ofcontext
will be the view's controller unless you override it.
Gonna merge this in since it's the right thing to do, and fix Discourse before upgrading in there.
P.S. Thanks!
Thing is that
context
automatically goes as template context whilecontent
not. Actually I see the only way to use object from content in templates: bindcontext
tocontent
:contextBinding: 'content'
.BTW really interesting question is why
Ember.CollectionView
puts items tocontent
for it'schildViews