Welcome Guest! (App Version 5.16)

websitnero logo name


What are Modules in Angular?

Modules are at the core of Angular. Module can be understood as a package which consists of interrelated parts and bits which work together to get some functionality done and also can be exported easily as a final package, so that if required on inclusion it be used in any other app.

Following are some examples of Modules (included in Angular Library):

  • Forms Module
  • HttpClientModule
  • RouterModule

Following are also some examples of Modules (as 3rd party Library):

  • Material Design
  • Ionic
  • AngularFire2

In angular modules are build with the help of keyword @ngModule. This keyword helps in configuring injector and compiler to help in organizing all related files and compiling them to get one final JavaScript file which would then be added as module to be exported to any other application.

@ngModules takes an object as metadata which provides information regarding how to compile a component's template, the logic in typescript and about creating injector at runtime. It identifies which are this modules own component, directives, services, pipes and other files and finally exports them to make public to be used elsewhere.

Modules of Angular are generally loaded at once when application starts, but on requirement they can be loaded asynchronously when required via lazy-loading of router.

Further Reading

1. NgModules

WebsiteNero is highly optimized for learning various website developing technlogies. We try our best to add maximum modules and examples to help learn the concepts clearly and vividly. We try to present all content and examples as simple as we can removing any complexity to hurdle easy understanding. We try best provide you with worthful content, but we cannot guarantee full correctness of all the content on this site. While using this website, you agree to have read and accepted all our terms of use and conditions, cookie, and privacy policy. Copyright, 2013-2018 by websitenero.com. All Rights Reserved.