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

后端 未结 1 1966
情书的邮戳
情书的邮戳 2021-02-04 19:41

I\'m playing around with ember.js and am stuck somehow finding out how to build up the structure the right way. I could follow all examples, but have some problems putting them

相关标签:
1条回答
  • 2021-02-04 20:15

    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

    0 讨论(0)
提交回复
热议问题