Description
I'd like to report a shortcoming I've noticed in the guide, and suggest adding a further-reading link between two of its pages. I don't understand the issue well enough to suggest another edit.
While adding the router service to an event-handler object (EmberObject subclass) I got the error Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container
, which seems similar to https://stackoverflow.com/questions/34970881/inject-a-service-into-an-ember-object-not-an-ember-controller
Everything else on the event handler has been working ok with the import
and create
approach, but when I tried to load in the router service I hit the error.
The assert is useful, and has helped me figure out what to do next, but it seems like the guide should cover this. Instead it only talks about using create
.
Explaining why this is needed or different from import
/create
would be great (maybe transcribing @locks's stackoverflow post), but it'd be simpler to put something short at the bottom of classes and instances suggesting further reading of dependency injection or even registering singletons vs non-singletons as further reading.