What classes should I add to the declarations array?
Add declarable classes—components, directives, and pipes—to a declarations list.
Declare these classes in exactly one module of the application. Declare them in a module if they belong to that particular module.
What is the declarations array
The module's declarations array tells Angular which components belong to that module. As you create more components, add them to declarations.You must declare every component in exactly oneNgModule
class.The compiler emits an error if you try to declare the same class in more than one module.These declared classes are visible within the module but invisible to components in a different module.An example of what goes into a declarations array follows:declarations: [ YourComponent, YourPipe, YourDirective ],
0 comments:
Post a Comment