Difference between NgModule and JavaScript Modules
Javascript Modules | NgModules |
---|---|
Contains Individual File of javascript code. | Contains classes with metadata marked by @Ngmodule decorator. |
export statement is used to exporting the code. | @Ngmodule is used with metadata. |
Across files, it organise and manage the code. | it structures and configure the angular components. |
metadata is not present in it. | Metadata is needed for angular compilation. |
Organise file in separated files | Kept the code in separate file but not necessity. |
Can be used in Angular application but lacks of Angular-specific features. | Essential for structuring angular application. |
Differece between JavaScript Modules & NgModule
Modules play an important role in structuring and organizing the code of Javascript and Angular.js. They help us to use the code efficiently. Majorly NgModule in Angular.js and Modules in Javascript are widely used in different scenarios.
In this article, We will learn about Modules and their importance in Angular.js and Javascript.
Table of Content
- Javascript Modules
- Features of JavaScript Modules
- NgModules
- Features of NgModules
- Difference between NgModule and JavaScript Modules
- Conclusion
Contact Us