I am pretty new to the world of Angular. What is the difference between CommonModule
vs BrowserModule
and why one should be preferred over the othe
From the docs
BrowserModule provides services that are essential to launch and run a browser app.
BrowserModule also re-exports CommonModule from @angular/common, which means that components in the AppModule module also have access to the Angular directives every app needs, such as NgIf and NgFor.
whereas
CommonModule (all the basics of Angular templating: bindings, *ngIf, *ngFor…), except in the first app module, because it’s already part of the BrowserModule
Also read this.