I define MyService
in LazyLoadedModule
.
Is it then possible to use this MyService
in the AppModule
? Or can it just be used in the LazyLoadedModule
itself?
Asked
Active
Viewed 35 times
1 Answers
0
If you are using cli to define a service in your lazyLoadedModule you will notice
@Injectable({
providedIn: 'root'
})
means the service is available with the application.
Additionally you might find this answer useful Angular: Lazy loading modules with services

maxkart
- 619
- 5
- 21
-
I am struggeling because when importing a lazy module I am not allowed to have the regular import statement. But when I want to use a service from the module I need to import i tthe normal way to have the auto-completion, etc. working – matthias Oct 06 '20 at 10:00