How can I dynamically insert a new template into the DOM with Ember?

偶尔善良 提交于 2019-12-01 04:11:28

You can create a new view and append it to the DOM using Ember.View's append or appendTo methods.

App.MyView = Ember.View.extend({
    templateName: 'a_template'
})

var view = App.MyView.create();

// Append the view to the document body
view.append();
// ...or append to any element described using
// a jQuery-compatible selector.
view.appendTo('#my-div');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!