Ember.js dynamic child views

泄露秘密 提交于 2019-12-10 10:05:13

问题


I'm having trouble getting ember to render a dynamic child view. It seems that once the child view is rendered, the binding is lost. Here's a jsfiddle

http://jsfiddle.net/zaius/XYzfa/

As you click between the two editor pages, the child view remains on the first view that was rendered. Is there a way to tell ember to refresh the view, or am I going about this completely the wrong way?

I'm brand new to ember, so any general feedback on my code is welcome too.


回答1:


You should consider using Ember.ContainerView (see documentation) for such dynamic content.

Illustrating JSFiddle here (I also refactored your code a little to be more idiomatic).



来源:https://stackoverflow.com/questions/9795398/ember-js-dynamic-child-views

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!