app.module.ts
import { NgModule } from \'@angular/core\';
import { BrowserModule } from \'@angular/platform-browser\';
import { Forms
You probably created another module and declared component you are using there, but you forgot to import CommonModule
which provides common directives such as *ngIf
and *ngFor
. You don't need to do this in your AppModule
because you import BrowserModule
there which exports CommonModule
, so these directives are available in AppModule
.