0

My 16.1.4 angular app is dynamically loading a component. Inside that component I have an array and am trying to use ngFor. ngFor will not display anything. If I show the number of entries in the array I'm trying to loop it correctly shows the right number. It just won't loop through my array. No errors in console either.

START BREADCRUMB: {{components.length}}
   <span *ngFor='let component of components;'>
      {{component.title}}
   </span>
END

All that renders in my browser is START BREADCRUMB: 2 END

In other components that are not dynamically loaded, ngFor works as expected.

Any ideas on how to troubleshoot this?

happyfirst
  • 1,033
  • 1
  • 13
  • 27

1 Answers1

0

The credit for this answer really should go to @Benny for his comment

Your tip indirectly helped me find the issue. When I tried the json pipe I got an error that it was not found. Googling that error led me to No pipe found which led me to realizing my dynamic component was not declared in my parent module. As soon as I declared it, my ngFor's started working.

happyfirst
  • 1,033
  • 1
  • 13
  • 27