Created
August 22, 2016 13:52
-
-
Save abuiles/ec8d2ab97b0e79aa1f62da8d2d2a8ad7 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({ | |
plugins: Ember.inject.service(), | |
model(params) { | |
/* | |
I'm assuming the plugin service have a method called mount | |
which "mounts" a plugin. This method returns a promise... Ember | |
won't move out of the model hook. | |
*/ | |
return return this.get('plugins').mount('search').then((plugin) => { | |
return plugin.search(params.query); | |
}); | |
}, | |
deactivate() { | |
return this.get('plugins').unmount('search'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment