What is a Angular module?
Modules are logical boundaries in your application and the application is divided into separate modules to separate the functionality of your application. Lets take an example of app.module.ts root module declared with @NgModule decorator as below,
import { NgModule } from '@angular/core';import { BrowserModule } from '@angular/platform-browser';import { AppComponent } from './app.component';@NgModule({imports: [BrowserModule],declarations: [AppComponent],bootstrap: [AppComponent],providers: [],})export class AppModule {}
The NgModule decorator has five important(among all) options
- The imports option is used to import other dependent modules. The BrowserModule is required by default for any web based angular application
- The declarations option is used to define components in the respective module
- The bootstrap option tells Angular which Component to bootstrap in the application
- The providers option is used to configure set of injectable objects that are available in the injector of this module.
- The entryComponents option is a set of components dynamically loaded into the view.
November 03, 2022
1216
Read more
What is Angular Framework?
November 04, 2022
AngularWhat are the steps to use animation module?
October 31, 2022
AngularWhat is State function?
October 30, 2022
Angular