2
MyEmberApp.ApplicationRoute = Ember.Route.extend({
beforeModel: function() {
console.log(this);
console.log(this.controllerFor('application').get('currentPath')); // Undefined.
console.log(this.controllerFor('application').currentPath); // Undefined.
// console.log(this.controller.currentRouteName); // Undefined.
// console.log(Mars.__container__.lookup("controller:application").get("currentRouteName")); // Undefined.
// console.log(this.controllerFor("application").get("currentPath")); // Undefined.
// console.log(this.controllerFor("application").get("currentRouteName")); // Undefined.
this.transitionTo(THE ROUTE NAME I FIND...);
}
});
我在做什么错?即使官方文件说我必须这样做http://emberjs.com/guides/understanding-ember/debugging/。Ember的currentPath和currentRouteName始终未定义
如何在集成测试中获得它? – SuperUberDuper 2015-01-20 13:35:21