1
私はこの問題のために頭を失いました:init
とsessionAuthenticated
のApplicationRouteMixin
は一緒に使うことはできません!ApplicationRouteMixinのinitとsessionAuthenticatedは一緒に使用できません
import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
import other from '../other';
export default Ember.Route.extend(ApplicationRouteMixin, {
init: function() {
otherJsImImportingMainFunction();
},
sessionAuthenticated() {
this.transitionTo('someRoute');
debugger;
}
actions: {
...
}
};
この状況では私のコードは動作しません。私のルートで
/は、私がこのような何かを持っているapplication.js。
私は認証してから、sessionAuthenticated()は呼び出されません。
"init:"とコメントアウトしてもうまくいきます。
これを修正するにはどうすればよいですか?
このようにインポートしていますか?