0
后,我有我的application.js
路由与Github上登录,然后重定向到一个名为AUTH控制器,如下动作:不能重定向到控制器功能
import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
export default Ember.Route.extend(ApplicationRouteMixin, {
actions: {
login() {
var controller = this.controllerFor('auth');
this.get('torii').open('github-oauth2').then(function(authData){
console.log(authData);
controller.transitionTo('auth');
}, function(error){
console.log(error);
});
}
}
});
,但我得到以下错误
ember.debug.js:19750 TypeError: controller.transitionTo is not a function
at application.js:8
at tryCatch (ember.debug.js:52155)
at invokeCallback (ember.debug.js:52170)
at publish (ember.debug.js:52138)
at ember.debug.js:41257
at invoke (ember.debug.js:990)
at Object.flush (ember.debug.js:1054)
at Object.flush (ember.debug.js:862)
at Object.end (ember.debug.js:176)
at Object.run (ember.debug.js:298)
我真的不知道我在这里错过了什么。 我已经尝试过var controller = this.controller
,并没有工作,以及