Created
October 27, 2015 01:33
-
-
Save gregtap/9ed763e20dcab12caf04 to your computer and use it in GitHub Desktop.
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
| Uncaught ReferenceError: isMenuVisible is not defined | |
| this.core.get('isMenuVisible') is undefined. | |
| What I want to do here is having distinct components to react and listen to `isMenuVisible` data change. |
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
| import Ember from 'ember'; | |
| // App level variables. | |
| var core = Ember.Object.extend({ | |
| isMenuVisibile: false, | |
| }); | |
| export function initialize(application) { | |
| // register factory for dependency injection. | |
| application.register('core:variables', core, {singleton: true}); | |
| // Inject our factory in all `controller` and `components`. | |
| application.inject('component', 'core', 'core:variables'); | |
| } | |
| export default { | |
| name: 'application', | |
| initialize: initialize, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment