Created
October 6, 2014 22:17
-
-
Save lukes/0c9b15ddabbd6b0b7be0 to your computer and use it in GitHub Desktop.
Making currentPath available to all controllers
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'; | |
export default Ember.ObjectController.extend({ | |
currentPathDidChange: function() { | |
this.set('path.content', this.get('currentPath')); | |
}.observes('currentPath') | |
}); |
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 CurrentPath from "../models/current-path"; | |
export default { | |
name: 'currentPath', | |
after: 'store', | |
initialize: function(container, application) { | |
container.register('app:currentPath', CurrentPath, { singleton: true }); | |
container.typeInjection('controller', 'path', 'app:currentPath'); | |
} | |
}; |
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'; | |
export default Ember.ObjectProxy.extend({}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment