Ember.js dynamic child views

2019-05-10 14:59发布

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条回答
闹够了就滚
2楼-- · 2019-05-10 15:39

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).

查看更多
登录 后发表回答