Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should the object model guide talk about factory registration? #144

Open
nruth opened this issue Sep 4, 2018 · 0 comments
Open

should the object model guide talk about factory registration? #144

nruth opened this issue Sep 4, 2018 · 0 comments

Comments

@nruth
Copy link
Contributor

nruth commented Sep 4, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants