NG Module metadata
cloud

NG Module metadata

Ng module metadata refers to a single object within an angular module whose properties are used in an angular application to facilitate compilation.

The properties (metadata) describe the module.

No alt text provided for this image

Declarations

Declarations refers to all the components, directives and pipes that belong to the module. All angular modules must have a declarations array.

Imports

Imports refers to all the modules that have been exported and have classes which are needed in the same module.

No alt text provided for this image

These modules can be custom modules such as a shared modules or predefined modules such as angular material module and http modules. Every angular module requires an imports array.



Exports

The exports are an array of of all declarations that are required to be visible in other modules that have imported the module. For example, in side a navigation module, a navbar component can be exported so as to be visible in other modules which have used the declarations.

No alt text provided for this image

Providers

No alt text provided for this image

Providers refers to creators of services within the module that are used all over the angular application. Provider array ensures that services can be singleton classes Providers make sure that services are globally available.


Bootstrap

This metadata property is only on the root module. It holds the root component that renders all the views.

No alt text provided for this image





To view or add a comment, sign in

More articles by Paul C.

  • Component Interaction In Angular

    Component interaction refers to communication between two or more components created in an Angular application. This…

  • View Encapsulation

    Encapsulation is the concept of bundling similar blocks of code together as one unit. In this article, I talk about…

    2 Comments
  • Angular Lifecycle methods

    Lifecycle hooks are methods called from the creation of a component or a directive to its destruction. For directives…

  • Basic MongoDB Commands

    Starting MongoDB mongo --host localhost:27017 2. Log Into mongoDB.

  • API with Mongo Express and Node (the sequel)

    I was creating the waiter who will connect the back-end of the application to the front-end. The link to the exciting…

  • API with Mongo, Express and Node (part 1)

    APIs, Application Programming Interfaces, are essential for any web and mobile applications since they serve as…

  • My first boot-camp month!

    How a month goes by so fast! Such an interesting month. I could talk about the data structures, I could talk about the…

    4 Comments

Explore content categories