Ember.js - doing it right (structure, includes, general questions)

五迷三道 提交于 2019-12-03 00:40:25

if you use the latest release of ember with v2 router, you can do something like this:

App.Router.map(function (match) {
    match("/").to("categoryList", function (match) {
        match("/").to("foo");
    });
});

In your catergoryList template, put an {{outlet}} (you can optionally name it)

Then, your route for the template you want to insert into catergoryList will be like this:

App.fooRouter = Ember.Router.extend({
renderTemplates:function () {
        this.render('foo', {
            into:'catergoryList'
        });
    }
})

A good example of this in practice can be found here: https://github.com/sh4n3d4v15/ember-todos

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