Created
October 3, 2013 16:35
-
-
Save taras/6812841 to your computer and use it in GitHub Desktop.
What if we removed special meaning from **redirect** hook and added a new syntax that would allow hooks to be triggers 'before' or 'after' another hook? We would add a deprecation notice to **redirect** that would state that **redirect** has no special meaning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| App.IndexRoute = Ember.Application.extend({ | |
| redirect: function(transition) { | |
| this.transitionTo('movies'); | |
| }.before('model') // execute before model hook | |
| }); | |
| App.IndexRoute = Ember.Application.extend({ | |
| redirect: function(model, transition) { | |
| this.transitionTo('movies', model); | |
| }.after('model') // execute after model hook | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment