0
我使用的是containerview,我使用currentview财产动态添加和删除上下文的形式,有点像这样:ember.js containerview涉及
showSomeForm: ->
form = @get('theContainerView')
if form.get('currentView')
form.set('currentView', null)
contextualForm = App.Form.create
controller: App.Controller.create()
showSomeOtherForm: ->
form = @get('theContainerView')
我担心的就是内存泄漏,每次创建控制器如果这是做事的最佳方式。
一旦用户完成了上下文形式,我还将currentView设置为null以隐藏它。
有没有更好的方法来做到这一点,我目前在ember v1.0.0-pre.2-54。