Created
January 22, 2015 16:42
-
-
Save foxnewsnetwork/51cb80a64c690c8eaec8 to your computer and use it in GitHub Desktop.
Emberjs initializer to get the store in your components
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
initialize = (ctn, app) -> | |
app.inject "component", "store", "store:main" | |
ComponentStoreInitializer = | |
name: 'component-store' | |
initialize: initialize | |
# Then, wherever you're creating your app, do the following: | |
Ember.Application.initializer ComponentStoreInitializer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This initializer allows you to access this.store in your components, handy as some components need semi-static resources that should be fetched once and only once from the server somewhere.