Учитывая следующие настройки маршрутизатора:Как получить путь к маршруту?
App.Router.map(function() {
this.resource('posts', function() {
this.route('new');
this.resource('post', { path: ':post_id' }, function() {
this.route('edit');
});
});
});
Возможно ли это, чтобы получить путь маршрута?
Фиктивный пример:
App.Router.get('path', 'posts.new'); //=> "/posts/new"
Или с моделью, как:
App.Router.get('path', 'post.edit', model); //=> "/posts/1/edit"
Возможно, вы хотите взглянуть на источник. ['LinkView'] (https://github.com/emberjs/ember.js/blob/master/packages/ember-routing/lib/helpers/link_to.js#L112-L117) реализует это значение – MilkyWayJoe