2013-10-09 13 views
0

我有一條路線,捕捉所有缺少的路線,並呈現404樣式的頁面。我想創建一個匹配任何以「/ browse /」開頭的url的路由,例如「/ browse/shoes/red」。這似乎是正確的方式做到這一點:Catch-all路線優先於星際路線在燼

App.Router.map(function() { 
    this.route('browse', { path: '/browse/*fields' }); 
    this.route('missing', { path: '/*badPath' }); 
}); 

然而,Ember的RouteRecognizer總是選擇在瀏覽路線缺少路線。 (這樣做的邏輯是在route-recognizer.js的sortSolutions中。)這是Ember中的一個錯誤嗎?有沒有正確的方式來使用glob路線,仍然有一個404處理程序?

順便說一句,我可以創建瀏覽的資源,而不是使它的路線是這樣的:

App.Router.map(function() { 
    this.resource('browse', { path: '/browse' }, function() { 
    this.route('baz', {path: '/*'}); 
    }); 
    this.route('missing', { path: '*' }); 
}); 

這仍然有同樣的問題。

回答