SharedModuleand define the
CounterService. We are going to use this service in
LazyComponentin exactly the same way. Just a button to increase the internal
counterproperty of the service.
counterseems to behave independently in
LazyComponent, we can increase the value of one counter without altering the other one. In other words, we have ended up with two instances of the
CounterService, one that lives in the root of the DI tree of the
AppModuleand another that lives in a lower branch of the DI tree accessible by the