P
P
Pantene7422018-09-01 22:45:21
Angular
Pantene742, 2018-09-01 22:45:21

Why when I use service in guard(e), it is created by a new instance?

Guard and Service are part of the same module. Initialized in providers.
When I use the service in different components of the project, the data is the same.
And in the Guard, when I inject this service, it is created as a separate instance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question