У меня есть 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
Вы знаете, что не так с моим кодом на данный момент?
Спасибо