J
J
Jebati2020-05-02 18:03:58
Angular
Jebati, 2020-05-02 18:03:58

Why doesn't ngForOf work in lazyload component?

Angular 9

#app.module.ts
  imports: [
    BrowserModule
  ]

#admin.module.ts - подгружается
  imports: [
    CommonModule
  ]

When trying to use *ngFor in a lazy-loaded component, the console says
Can't bind to 'ngForOf' since it isn't a known property of 'ng-container'.

What could be the problem?

5ead91a8ebb72364159483.png
5ead91cea7dbd570937366.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Jebati, 2020-05-02
@Jebati

My cant... :) forgot the component in which *ngFor to add to declarations

A
Anton Shvets, 2020-05-02
@Xuxicheta

You have the answer right in the question.
CommonModule is not. ngFor directive in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question