我正在玩Ember,我有一个简单的页面,我尝试定义这样的路线:
App.Router.map(function() {
this.resource('posts', function() {
this.route('new');
});
});
此代码完全从here复制。当我尝试在浏览器中打开index.html#posts
时,出现此错误:
Assertion failed: The URL '/posts.index' did not match any routes in your application
我正在运行Ember 1.2.0。
答案 0 :(得分:1)
您还必须定义帖子索引路径
App.PostsIndexRoute = Em.Route.extend({
});
或只是帖子路线
App.PostsRoute = Em.Route.extend({
});