you need to reference in this module's component templates.
This always means importing CommonModule from @angular/common for access to the Angular directives such as NgIf and NgFor. You can import it directly or from another module that re-exports it.
Import FormsModule from @angular/forms if your components have [(ngModel)] two-way binding expressions.
Import shared and feature modules when this module's components incorporate their components, directives, and pipes.
Import only BrowserModule in the root AppModule.
Should I import BrowserModule or CommonModule?
The root application module (AppModule) of almost every browser application should import BrowserModule from @angular/platform-browser.
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.
Do not import BrowserModule in any other module. Feature modules and lazy-loaded modules should import CommonModule instead. They need the common directives. They don't need to re-install the app-wide providers.
вроде да? browsermodule импортирую в appmodule, в остальных commonmodule и formsmodule
Обсуждают сегодня