【发布时间】:2014-05-07 20:03:29
【问题描述】:
我为我的应用程序定义了一个Router.map。我正在使用 EmberJS AppKit 架构。 https://github.com/stefanpenner/ember-app-kit
我想使用以下路径访问我的页面“个人资料”:
http://localhost:8000/#/profile
但是,我的路由名称与这条路径不同,因为它叫user-profile,所以我这样做了:
router.js
var Router = Ember.Router.extend();
Router.map(function () {
this.resource('user-profile', { path: 'profile'}, function() {
//Some other things...
});
});
export default Router;
user-profile.js
export default Ember.Route.extend({
model: function () {
return this.store.find('user-profile');
}
});
当我启动我的应用程序时,Ember 告诉我 profile 路由不存在,即使我定义了路径:
Uncaught Error: Assertion Failed: Error: Assertion Failed: The URL '/profile' did not match any routes in your application
你知道我的代码现在有什么问题吗?
谢谢
【问题讨论】:
标签: javascript model-view-controller ember.js ember-router