Skip to main content

Posts

Showing posts with the label Angular 2 Modules vs. JavaScript Modules

Angular 2 Modules vs. JavaScript Modules vs. Angular 1 Modules

Angular 2 Modules - The Angular module — a class decorated with @NgModule — is a fundamental feature of Angular. JavaScript also has its own module system for managing collections of JavaScript objects. It's completely different and unrelated to the Angular module system. Angular Modules are the unit of reusability. Angular modules represent a core concept and play a fundamental role in structuring Angular applications. Every Angular app has at least one module, the root module, conventionally named AppModule. Important features such as lazy loading are done at the Angular Module level. Angular Modules logically group different Angular artifacts such as components, pipes, directives, and so on. Angular Modules help to organize an application into cohesive blocks of functionalities and extend it with capabilities from external libraries. App module looks like below, import { NgModule } from '@angular/core' ; import { RouterModu...