How does Angular ensure that a module is only loaded once regardless of how many times it is lazily loaded?
- Angular maintains a global module registry
- Modules are inherently singletons
- Modules are loaded using the HttpClientModule
- Modules must be explicitly marked as singletons
In Angular, modules are inherently singletons. This means that once a module is loaded, it is cached and reused throughout the application. Even if it's lazily loaded in multiple places, the same instance is shared, reducing duplication and improving performance.
Loading...
Related Quiz
- What does 'View Encapsulation' in Angular control?
- When you want to get only the first emitted value from an Observable and then complete, you should use the ________ operator.
- How can you programmatically navigate to a different route in an Angular application?
- Which attribute can be added to a form control to make it required?
- In Ngxs, what is used to define metadata for state operations?