FrontendDeveloper.in

Angular question detail

Can I share services using modules?

No, it is not recommended to share services by importing module. i.e Import modules when you want to use directives, pipes, and components only. The best approach to get a hold of shared services is through 'Angular dependency injection' because importing a module will result in a new service instance.

Back to all Angular questions
Get LinkedIn Premium at Rs 399