DockYard / ember-cart

Shopping cart primitives for Ember
MIT License
53 stars 18 forks source link

How to Inject this service into the Route #36

Closed JacobSamro closed 7 years ago

JacobSamro commented 7 years ago

Will you please explain how to inject this service into a route.

bcardarella commented 7 years ago

I think you have found a bug. The service is currently injected to Controllers and Components as cart:main however that means if you try and inject the service in the way services want to be injected in Ember:

cart: inject()

it will not work as expected as it will create difference instance.

I think the way to do this is to remove the instance initializer and just rely on service injection. If you want to PR this change let me know. Else I can probably do it later this week.

JacobSamro commented 7 years ago

Great it worked ! Thanks :dancing_men: