We are just on our first project with angular2. I've got a question about providing a service.
As I know, there are two ways to declare a provider with providers:[MyService]
in your app.
You can declare it globally in the @NgModule
tag or locally in the @Component
tag.
As far as I know, the only difference between the two ways is the providing scope. Once app wide, once only component wide. Out of this I would make the conclusion, that I should prefer to provide a service mostly (depending on the usage of the service) local in my specific component to keep the scope small.
Is that correct, or are there any other differences between the two declaration ways, which I'm not aware of?