title: *ngFor inside Dynamic Component Loader angular 5
body: <p>I would like to use ngFor and ngIf insie the template load dynamic.</p>
  
  <p>I used this tutorel by angular.io to load my dynamic template :
  <a href="https://angular.io/guide/dynamic-component-loader" rel="nofollow noreferrer">here</a> </p>
  
  <p>I have app.module :</p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import { AppRoutingModule } from './app-routing.module';
  
  @NgModule({
    declarations: [
      AppComponent,
    ],
    imports: [ 
        BrowserModule,
        AppRoutingModule, 
  
  
    ],
    providers: [
    ],
     })
   export class AppModule { }  
  </code></pre>
  
  <p>My second module :</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { CommonModule } from '@angular/common';
  @NgModule({
    imports: [
      CommonModule,
    ],
    providers: [
  
    ],
    entryComponents: [
      Template1Component,
      Template2Component,
      Template3Component,
    ],
    declarations: [
      Template1Component,
      Template2Component,
      Template3Component,
  
    ]
  })
  export class MyModule { }
  </code></pre>
  
  <p>the link between appModule and my module by appRoutingModule :</p>
  
  <pre><code>const appRoutes: Routes = [
  
    { path: 'site', loadChildren: '../myModule.module#MyModule' },
    { path: '**', component: PageNotFoundComponent },
  ];
  export const AppRoutingModule = RouterModule.forRoot(appRoutes);
  </code></pre>
  
  <p>my template 1 have that :</p>
  
  <pre><code>  &lt;ul&gt;
      &lt;li *ngfor="let specialite of specialites"&gt;
        {{specialite.nam}}
      &lt;/li&gt;
    &lt;/ul&gt;
  </code></pre>
  
  <p>everything work but when I use ngfor I have this error :</p>
  
  <pre><code>ERROR Error: Uncaught (in promise): Error: Template parse errors:
  Can't bind to 'ngforOf' since it isn't a known property of 'li'. ("
  
            &lt;ul&gt;
              &lt;li [ERROR -&gt;]*ngfor="let specialite of specialites"&gt;
                {{specialite.nam}}
              &lt;/li&gt;
  "): ng:// ........
  Property binding ngforOf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations".
  </code></pre>