0

我已经从 v1.4 更新了我的 ember v1.5。之后我的应用程序没有被渲染。在我的应用程序中,我在很多地方都使用了 _super()。有没有问题。我也在使用 require.js 。

我通过app调试,发现它触发了indexRoute。但在那之后什么都没有发生。下面是我的路线结构,

路线地图:

App.Router.map(function() {
    this.resource('public', { path: '/public' }, function() {
        this.route('login');
        this.route('logout');
    });
});

Ember.Router.reopen({
    transitionTo : function(name, param) {
        .......
        //Handling my  own code here
        .......
        this._super(name);
    }
});

App.BaseRoute = Ember.Route.extend({
    setup : function(context) {
        var thatSuper = this._super;
        require(_rp, function() {
                .......
                //Handling my  own code here
                .......
                thatSuper.call(self, context);
                ........
        }, function(error){
            ...Handling error.....
        });
    },
    renderTemplate : function(router, context) {
        window.scrollTo(0, 0);
    }
});

App.IndexRoute = App.BaseRoute.extend({
    redirect : function() {
        this.transitionTo('public.login');
    }
});

App.PublicLoginRoute = App.BaseRoute.extend({

    renderTemplate : function(router, context) {
    this._super(router, context);
        this.render('publicLogin', {
            into : 'applicationHBS',
            outlet : 'appBODY'
        });
    }
});
4

0 回答 0