You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, great job with the library! I love the Ember CLI, TypeScript and Glimmer! However, I've got a question for you - is is possible to somehow do service: Ember.inject.service() like in Ember? You write a lot about container, registry and Dependency Injection, but no examples how we could take advantage over this for example in Component (or maybe it's there, but I'm confused...). Is is possible to get container reference in component.ts or create something like service? :)
Should I create a typescript file which exports instance instead of class and that's it? Would it be Glimmer way?
@mixonic thanks for the response :) I already found your solution and gave it a try. I already discussed this topic with @locks in the slack channel. The conclusion was something like "it's not that easy". But I think services are a great way to split functionality and to organize code. Also they make testing easier. So I would love to see services as a "first class citizen" in glimmer.
Hey, great job with the library! I love the Ember CLI, TypeScript and Glimmer! However, I've got a question for you - is is possible to somehow do service: Ember.inject.service() like in Ember? You write a lot about container, registry and Dependency Injection, but no examples how we could take advantage over this for example in Component (or maybe it's there, but I'm confused...). Is is possible to get container reference in component.ts or create something like service? :)
Should I create a typescript file which exports instance instead of class and that's it? Would it be Glimmer way?
Or should I create an injection globally?
registry.registerInjection('component', 'store', 'store:main')
But I don't want to inject my instances everywhere. :)
I think I could also globally register something like container and then access individual objects on that object. But still doesn't feel great.
The text was updated successfully, but these errors were encountered: