Angular & Signals (283 Qs)•Part 9: NgModules, Providers, NgZone & Injector Hierarchies (213 - 255)
What classes should not be added to declarations?
The below class types shouldn't be added to declarations
- A class which is already declared in any another module.
- Directives imported from another module.
- Module classes.
- Service classes.
- Non-Angular classes and objects, such as strings, numbers, functions, entity models, configurations, business logic, and helper classes.
Practical Code Example
text
// Classes NOT allowed in declarations:
// Services, interfaces, model types, plain classes, and NgModules.