[Bu yeni 1.0.0-pre.4 + yönlendirici ile ilgilidir.]Kor yönlendirici: Asenkron modeli (söz?)
Bir Kor rota'nın model
metoda asenkron geri aramalar ihtiyacı olan bir kayıt dönmek istiyorum Örneğin, birden fazla (iç içe) model yüklememiz gerektiğinden. Bunu yapmanın en iyi yolu nedir?
App.Router.map ->
@resource 'filteredArticles', path: '/:filter'
App.FilteredArticlesRoute = Ember.Route.extend
model: (params) ->
blog = App.Blog.find(1) # get the user's Blog singleton
property = switch params.filter
when 'published' then 'publishedArticles'
when 'draft' then 'drafts'
when 'all' then 'articles'
# Return the list of articles from the `blog` record.
# But `blog` hasn't necessarily finished loading :(
blog.get(property)
Bildiğim kadarıyla kod istirahat bunu bir göz atabilirsiniz zaman uyumsuzluğu getirilecek başka bir söz verir. –
Keşke yapsaydı, ama sadece güncellenmeyen boş bir diziyi döndürür - AppBlog.find (1) .get ('makaleler') 'yeniden çalıştırıldığında bile boş olmayan bir dizi verir. –
Bu benim için bir github sorunu gibi daha fazla hissediyor :) –