Best Answer · By JanBask Python Expert
Answered on Dec 15, 2019
Angular and JavaScript uses the modules in order to organize the code differently.
JavaScript modules-
In this, modules are the individual files having JavaScript code. We have to write export statement in order to make them available usually after relevant code as,

After that, when we need this file code into another file, we have to import it as,

These are the classes with @NgModule directive, which imports the array which the present module needs. These modules differ from the JavaScript modules as these are the NgModules which are not like the regular modules of JavaScript.
The AppModule which is generated from Angular CLI, demonstrate both JavaScript Modules and NgModules as-

NgModules classes is different from the JavaScript modules as-
NgModule bounds the declarable classes which matter to Angular Compiler only.
JavaScript modules define all the members of classes into one big file, whereas, in the NgModule the classes are listed using the list, @NgModules.declarations.
NgModule exports only the declarable classes which it owns or can be imported from the other modules.
NgModule extends the whole app with the services just by adding the providers to @NgModule.providers list.