当我明确定义路由时,Ember 无法呈现关联的模板。renderTemplate
每次创建显式路由时,是否必须在路由对象中指定属性?为了更清楚,这是我的例子:
define(['ember'],
function(Ember) {
"use strict";
var DudeRoute = Ember.Route.extend({
model: function() {
},
setupController: function() {
},
renderTemplate: function() {
}
});
return DudeRoute;
});
如果我在我的应用程序中这样指定:
define([ ... ],
function(
Router,
IndexRoute,
DudeRoute,
ApplicationController,
IndexController
) {
"use strict";
/*Module Pattern*/
var App = {
LOG_TRANSITIONS: true,
Router: Router,
// Load routes
IndexRoute: IndexRoute,
DudeRoute: DudeRoute,
//Load Controllers
ApplicationController: ApplicationController,
IndexController: IndexController
//Load Models
//Load Views
};
return App;
});
整个事情都崩溃了,它没有呈现我的模板。虽然如果我删除DudeRoute
一切正常。