Ember: template loading not working when promise is returned from Route app

I don't understand why the download template is not loaded in the following script

App = Ember.Application.create()

App.Router.map ->
  this.resource 'dashboard', {path: "/"}

App.ApplicationRoute = Ember.Route.extend
  beforeModel: ->
    new Ember.RSVP.Promise (resolve) ->
      Ember.run.later ->
        resolve()
      , 3000

App.DashboardRoute = Ember.Route.extend      
  model: ->
    ['red', 'yellow', 'blue']

      

http://emberjs.jsbin.com/jageg/2/edit?html,js,output

From the documentation, I figured out that if a route from path dashboard

returns a promise that doesn't resolve immediately, Ember will try to find a load route in the hierarchy that it can go to.

Thank.

+3


source to share


1 answer


Yes, the load path of the parent resource will be placed in the parent resource {{outlet}}

. Unfortunately for you, you are blocking the topmost resource, so Ember is unable to render and load the app template because of this.

If you block one level below it will end up on the app resource load route which is simple loading

.



http://emberjs.jsbin.com/babuzi/edit?html,js,output

+2


source







All Articles