【发布时间】:2013-05-09 21:02:20
【问题描述】:
鉴于以下路由器设置:
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实现了
标签: ember.js ember-router