Angular pitfall

I hit on a fairly esoteric issue in Angular:

Can't bind to 'ngForOf' since it isn't a known property of 'div'

Investigations show that this is due to the fact that the componant doesn’t have access to the definitions for the angular attributes (ngFor, ngIf etc…)

Most of the answers point to a missing CommonModule library in a ngModule definition. This didn’t help me and I only had the main module and router module. Previous projects had been fine so I was a bit stumped initially.

The answer was that I had missed the component in the declaration section of the module:

@NgModule({
  declarations: [
    AppComponent,
    TasksNavComponent,
    TasksComponent //<-- missing
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    LayoutModule,
    MatToolbarModule,
    MatButtonModule,
    MatSidenavModule,
    MatIconModule,
    MatListModule,
    HttpClientModule
  ],
  providers: [TaskService],
  bootstrap: [AppComponent]
})

export class AppModule { }

Back to index page of the project is about getting the initial rust API running.