有人可以帮助解释在此示例中何时使用字符串 VS 符号作为名称。在我的代码中,我将控制器定义为:
PostShowController = RouteController.extend({
template: 'userShow'
});
// 为什么不同,我的代码只适用于 PostShowController 周围的单引号,但 Telescope 使用符号方式: https ://github.com/SachaG/Telescope/blob/master/lib/router.js
Router.map(function () {
// provide a String to evaluate later
this.route('postShow', {
path: '/:name',
controller: 'PostShowController'
});
// provide the actual controller symbol if it's already defined
this.route('postShow', {
path: '/:name',
controller: PostShowController
});
});