What controls where Ember's Loading Route is displayed?

前端 未结 4 1866
刺人心
刺人心 2021-01-05 03:41

I would have thought that the LoadingRoute would display its template in the {{outlet}} of the main AppView, but it doesn\'t seem like it does. Wha

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-05 04:13

    My guess is that this behavior is intentional, so the LoadingRoute could work while the ApplicationRoute itself is loading. Rendering the application template manually should allow you to render into one of its outlets.

    App.LoadingRoute = Ember.Route.extend({
        renderTemplate: function() {
            this.render("application");
            this.render("loading", { outlet: "loading", into: "application" });
        }
    });
    

提交回复
热议问题