5

This code works any where within my pages except for Popover and Modal. I get Can't bind to 'ngForOf' since it isn't a known property of 'div'

Is there any work around to this?

<div *ngFor="let u of users">
  <ion-row>
    <ion-col size="12">
      <ion-label>
        <ion-title>{{ u.first}}</ion-title>
      </ion-label>
    </ion-col>
  </ion-row>
</div>
users: any[] = [
  {
    id: 1,
    first: 'Alice',
    last: 'Smith',
  },
  {
    id: 2,
    first: 'Bob',
    last: 'Davis',
  },
  {
    id: 3,
    first: 'Charlie',
    last: 'Rosenburg',
  }
];
Tomas Vancoillie
  • 3,463
  • 2
  • 29
  • 45
Niang Moore
  • 506
  • 5
  • 17

1 Answers1

2

I have found the answer in this link, Where you should add the Modal component in the root app module: First import the Modal page in your app.module,

import {ModalPage} from "./home/modal.page"

then declares it inside declarations and entryComponents

declarations: [AppComponent,ModalPage],

entryComponents: [ModalPage],