What are the differences between ngmodule and javascript module?

Posted by Jennifer | Updated on

Below are the main differences between Angular NgModule and javascript module:

NgModuleJavaScript module
NgModule bounds declarable classes onlyThere is no restriction classes
List the module’s classes in declarations array onlyCan define all member classes in one giant file
It only export the declarable classes it owns or imports from other modulesIt can export any classes
Extend the entire application with services by adding providers to provides arrayCan’t extend the application with services

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers