Understanding of Modules

With JS there is always a problem with namespaces. If we don't get careful we could end up getting issues with global variables and functions namespace. It also dont provide feature of code organisation. Modules help resolve these issues.

ES 2015 Module
Whenever we use export or import files using class, it becomes module in ES 2015 module.

Angular Module
Every angular application has at least one root module called app module. If it has more features, we can group them with its feature module. We can also create shared module for codes used by multiple angular modules.

ES 2015 Module VS Angular Module

Share this

Related Posts