-
Notifications
You must be signed in to change notification settings - Fork 24
Modules
ashwanth kumar Reddy edited this page Sep 24, 2023
·
2 revisions
AngularJS and Angular has different meaning for modules but on a general scale . Angular modules help in organizing components, directives, services, and other application artifacts.In Angular applications are modular and Angular has its own modularity system called NgModules. NgModules are containers for a cohesive block of code dedicated to an application domain, a workflow, or a closely related set of capabilities.
In AngularJS, you typically bootstrap (initialize) your application by specifying the main module in the ng-app directive in the HTML.
angular.module('infoModal', ['versionInfo']);
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { InfoModalComponent } from './info-modal.component';
import { ajskommonitorDataExchangeServiceeProvider } from 'app-upgraded-providers';
@NgModule({
declarations:[InfoModalComponent],
imports:[CommonModule],
exports:[InfoModalComponent],
bootstrap:[InfoModalComponent],
providers:[ajskommonitorDataExchangeServiceeProvider]
})
export class InfoModalModule{
}
Here, you specify other modules that the current module depends on. This includes Angular's built-in modules as well as custom modules created for organizing functionality.
The providers property is used to specify services that are available for dependency injection within the module. Services declared here can be used by components and other parts of the module.
This property specifies the root component of the application, this is the one that is loaded automatically once the component is loaded