Last active
August 29, 2015 14:07
-
-
Save zzarcon/0d5a2dbc9650b79c7a8a to your computer and use it in GitHub Desktop.
Route dependencies
This file contains 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.FooRoute = App.Route.extend({ | |
dependencies: ['session.team.championship', 'session.team.teamReport', 'customDependency','position', 'user:12345', 'lineup:cached'], | |
customDependency: function() { | |
return new Ember.RSVP.Promise(); | |
} | |
}); |
I like this approach to load dependencies! 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By this way we can load route dependencies in a more semantic and easy way.
The array of dependencies admits:
-Properties of the object:
session.team.championship
,session.team.teamReport
orcustomDependency
-Ember data models:
positions
-Models with id:
user:12345
where 12345 is the id of the user-Use of
cachedFind
method:lineup:cached