Skip to content

Instantly share code, notes, and snippets.

@lukes
Created October 6, 2014 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukes/0c9b15ddabbd6b0b7be0 to your computer and use it in GitHub Desktop.
Save lukes/0c9b15ddabbd6b0b7be0 to your computer and use it in GitHub Desktop.
Making currentPath available to all controllers
import Ember from 'ember';
export default Ember.ObjectController.extend({
currentPathDidChange: function() {
this.set('path.content', this.get('currentPath'));
}.observes('currentPath')
});
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');
}
};
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