In java script we have problem with namespaces and also with code organization.
Modules provide a solution for this problem.They enable us to decouple our code easier.
Types of modules .
Angular 2 has its own modules.They are different from Angular 2's implementation of ES 2015 modules
The main difference is ES files are about code files and angular modules are about our application
Modules provide a solution for this problem.They enable us to decouple our code easier.
Types of modules .
- Angular 1 modules
- Typescript modules
- Angular 2 modules
- ES 2015 modules
Lets discuss about angular 2 and ES 2015 modules
ES 2015 Modules
- ES6 modules are stored in files. There is exactly one module per file and one file per module
- Before a module can imported, it first needs to be exported as a module
- Once a module has been exported it can easily be imported from another file
Angular 2 Modules
Angular 2 has its own modules.They are different from Angular 2's implementation of ES 2015 modules
- Help organize and application into cohesive blocks of functionality
- Every angular application has at least only one angular module by convention called as app module
- We can have our own feature module and also shared module
We can load all modules at start or lazy load it later
- We define an angular module with a class
- We identify the angular module by attaching @NgModule decorator and passing the metadata in finding the detail of this angular module
Difference between ES modules and angular modules
The main difference is ES files are about code files and angular modules are about our application
nice information on data science has given thank you very much.
ReplyDeleteData Science Training in Hyderabad
very informative article post. much thanks again
ReplyDeleteData Science Training in Hyderabad
I’m so happy to read this. This is the type of manual that needs to be given and not the accidental misinformation that’s at the other blogs. Appreciate your sharing this greatest doc. website designer nyc
ReplyDeleteSome times its a pain in the ass to read what people wrote but this website is real user genial ! . best branding agencies san francisco
ReplyDeleteSweet website , super layout, really clean and utilize genial . branding agency sf
ReplyDelete