Skip to content

Instantly share code, notes, and snippets.

@jakecraige
Created August 19, 2014 16:40
Show Gist options
  • Save jakecraige/411a03bf39db4616a69d to your computer and use it in GitHub Desktop.
Save jakecraige/411a03bf39db4616a69d to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Route.extend({
afterModel: function() {
this._super.apply(this, arguments);
var pushChannelName = this.pushChannelName || this.routeName;
var pushChannel = this.pushChannelFor(pushChannelName);
this.setupPushChannel(pushChannel, model);
},
pushChannelFor: function(name) {
return this.container.lookup('push-channel: ' + name);
},
setupPushChannel: function(pushChannel, model) {
if (pushChannel) {
pushChannel.set('model', model);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment