Angular – shared service between components doesn’t work

If you are providing your DataService inside the providers array of your @Component annotation, @Component({ … providers: [DataService], })… this service will be a singleton (it will create a new instance) for this component (and it’s children if they have not provided this service under their annotation also). If you want to use this service … Read more