Closed angelozerr closed 10 years ago
Marijn could you give me some directives to manage that please when you will have time. Thank's!
Well, the crappy docs 1 just spew a bunch of jargon, and don't really get into details, but the way I thought service
worked (and the way the plugin implements it) is that it is supposed to return a value, and that is the value that will be injected.
If it is even more magical than that, please explain how it works.
Okay, it appears that service
calls new
on the function it gets. Attached patch should help.
Wow, many thank's, it works like a charm.
With AngularJS you can define a 'cart' service of module like this :
And you can inject the 'cart' service in a controller like this :
It should be cool if tern could manage the completion for cart properties.
I have started to studied how to manag ethat, but no success for the moment. I think applyWithInjection should be improved to inject the 'cart' service. I try to create an instance of cart like this :
Many thank's for your help.