title: Can't bind to 'ngIf' since it isn't a known property of 'ng-container'
body: <p>The same thing is asked like 1000 times but I have CommonModule Injected.</p>
  <p>I have a lazy-loaded module and used on multiple routes like inside the main layout and outside of it</p>
  <p>It works perfectly but when I run tests cases in it, they keep throwing <code>Can't bind to 'ngIf' since it isn't a known property of 'ng-container'</code> even though I have injected common module and ViewChild is also returning undefined if it's inside ngIf or even if it's not the ViewChild just returns the start end tag of the component called.</p>
  <p>HTML of the in question module ( Test Module )</p>
  <pre><code>&lt;ng-container *ngIf=&quot;step === 'search'&quot;&gt;
    &lt;app-search #search&gt;&lt;/app-search&gt;
  &lt;ng-container&gt;
  &lt;app-unsaved #unsaved&gt;&lt;/app-unsaved&gt;
  </code></pre>
  <p>Component</p>
  <pre><code>@ViewChild('unsaved') unsaved: UnsavedComponent;
  @ViewChild('search') search: SearchComponent;
  </code></pre>
  <p>Routing</p>
  <p>In main layout</p>
  <pre><code>{
      path: 'test',
      canActivate: [ValidatedGuard],
      loadChildren: () =&gt; import('@app/test.module').then(mod =&gt; mod.TestModule)
  },
  </code></pre>
  <p>In lazy loaded routing</p>
  <pre><code>{ path: '', component: TestComponent, canDeactivate: [CanDeactivateGuard] }
  </code></pre>
  <p>Everything looks and it works fine but when I run the tests cases,</p>
  <pre><code>WARN LOG: 'Can't bind to 'ngIf' since it isn't a known property of 'ng-container'.'
  </code></pre>
  <p>and</p>
  <pre><code>ElementRef{nativeElement: &lt;app-unsaved&gt;&lt;/app-unsaved&gt;}
  
  
  
  @NgModule({
      declarations: [
          TestComponent
      ],
      imports: [
          TestRouting,
          CommonModule,
          SearchModule,
          QuotesModule,
          ConfirmModule,
          UnsavedModule
      ]
  })
  
  export class TestModule { }
  
  
  const routes: Routes = [
      { path: '', component: TestComponent, canDeactivate: [CanDeactivateGuard] }
  ];
  
  export const TestRouting = RouterModule.forChild(routes);
  </code></pre>