Skip to content
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.

AngularJS

Bootstrapping:

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']);

Angular

Bootstrapping:

Angular applications are typically bootstrapped by specifying the root module in the main.ts file, and Angular's module system takes care of loading the necessary components and services.
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{
}
Declarations:
This property is used to declare the components, directives, and pipes that belong to the module.
imports:
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.
providers:
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.
bootstrap:
This property specifies the root component of the application, this is the one that is loaded automatically once the component is loaded

AppModuleApp Module

Clone this wiki locally