Reaching Lazy Loading Module's Services Through Component

Viewed 17

In my code, I have a lazy loaded module which has a service named TestService. I want it to be used by a component that is inside my AppComponent (let's say that the component name is myComponent). How can I make myComponent access TestService? I wrote the code below and, called TesteService inside myComponent's constructor but it didn't really work since it is a lazy loaded module. What should I do?

FlightService TS:

@Injectable({
providedIn: 'root', 
})
public class TestService{ }
0 Answers
Related