I'm trying to create a service to handle modal dialogs in Ember 1.12 with Ember-cli. Maybe a service isn't the best way to approach this, but I want to access it from just about anywhere in the app, and be able to dynamically insert content into the popup, so it seemed like the right way to go.
Here is my service:
import Ember from 'ember';
export default Ember.Service.extend({
route: Ember.inject.service('route'),
open: function(content){
console.log('open popup', content);
this.get('route').render('popup-box', { //popup-box is a component
into: 'application',
outlet: 'popup'
});
},
close: function(){
//TODO
}
});
When I call the open method, I get this error:
Uncaught Error: Attempting to inject an unknown injection:
service:route
I'm not sure what I'm missing. Suggestions?
Aucun commentaire:
Enregistrer un commentaire