emberjs-1.0.0-RC-6.1
My controller:
Application.LoginController = Ember.Controller.extend({ loginFailed: false, isProcessing: false, isSlowConnection: false, timeout: null, login: function() { }, success: function() { this.reset(); }, failure: function() { this.reset(); }, reset: function() { clearTimeout(this.get("timeout")); this.setProperties({ isProcessing: false, isSlowConnection: false }); } });
My routing:
Application.LoginRoute = Ember.Route.extend({ setupController: function(controller, model) { controller.reset(); }, events: { } });
When I first go to "/ login", setupController is called. However, I would like to use an event (such as a transition) to call controller.reset () every time the application goes to login.
With LOG_TRANSITIONS: true
I see "Switch to" login "," Switch to "anotherPage" on the console, so I would like to know if it is possible to get an event that triggers these logs in my router.
Like:
Application.LoginRoute = Ember.Route.extend({ setupController: function(controller, model) { controller.reset(); }, events: { didTransition: function(reason) { controller.reset(); } } });
source share