Created
August 19, 2014 16:40
-
-
Save jakecraige/411a03bf39db4616a69d to your computer and use it in GitHub Desktop.
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
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