Angular needs NgModules to provide context to template compilation.
In short, when the Angular compiler encounters a component, directive or a pipe, it needs a class to associate to it, and it looks for this class in the same module where your component is declared. If it wasn't for modules, Angular would have to search all of your files, and potentially even pick the incorrect class.
That being said, the Angular team is looking into possibilities to get rid of NgModules.
Just wondering your thoughts on ECMA modules and if Angular should deprecate their system?
Angular needs NgModules to provide context to template compilation.
In short, when the Angular compiler encounters a component, directive or a pipe, it needs a class to associate to it, and it looks for this class in the same module where your component is declared. If it wasn't for modules, Angular would have to search all of your files, and potentially even pick the incorrect class.
That being said, the Angular team is looking into possibilities to get rid of NgModules.
Yes I think the ECMA modul system is far superior to NgModule and that Angular complier already has the directives need to go full blown ECMA modules.
One of the reasons React is so popular is ease of use. Until Angular understands that they will continue to slide in popularity.