singleton service

29 views
Skip to first unread message

Reza Razavipour

unread,
Dec 8, 2018, 12:50:23 PM12/8/18
to Angular and AngularJS discussion
If you provide a service in two components’ “providers” section of @Component decorator, how many instances of service shall get created?

Lucas Lacroix

unread,
Dec 8, 2018, 12:52:46 PM12/8/18
to ang...@googlegroups.com
Two.

Basically, you want a module to provide the service. So, if you've got one module for your application, it is your application module that should provide the service.

On Sat, Dec 8, 2018, 12:50 Reza Razavipour <reza.ra...@gmail.com> wrote:
If you provide a service in two components’ “providers” section of @Component decorator, how many instances of service shall get created?

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
Lucas Lacroix
Computer Scientist
Advanced Technology Division, MEDITECH

                
Subscribe to receive emails from MEDITECH or to change email preferences.
Reply all
Reply to author
Forward
0 new messages