What classes should I add to the declarations array? - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
What classes should I add to the declarations array?

What classes should I add to the declarations array?

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 one NgModule 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
    ],

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.