EmberJs - How do I update the content of a Handlebars template after loading a view?
Is there a way in Ember to update the content of the Handlebars template and dynamically render the dependent views?
I tried using method Ember.TEMPLATES
and Ember.Handlebars.compile
, but it didn't work and JSFiddle is available here , so any suggestion?
source to share
I don't know why you are trying this, but if it's just for testing, here is a working fiddle http://jsfiddle.net/VTP4n/2/ .
Ember caches the template inside the view as a computed property, so I override it and call it rerender
in the view. I wouldn't even consider using this in production.
Until recently, this was as easy as redefining a template and then calling view.notifyPropertyChange('template')
, but with the new content of the container, it was much more difficult to do it cleanly.
source to share