title: Getting " Can't bind to 'ngIf' since it isn't a known property of 'div' " even after importing Common Module - Angular 9
body: <p>I keep getting that error. I am importing the Common Module as well as declaring the component in my module! Please let me know what is wrong with it. ngif works fine on the components imported in the App Module. For some reason it does not work for this one. This module is being lazy loaded in the app routing module by the way.</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { CommonModule } from '@angular/common';
  
  import { EnterpriseRoutingModule } from './enterprise-routing.module';
  import { LandingComponent } from './pages/landing/landing.component';
  
  
  @NgModule({
    declarations: [LandingComponent],
    imports: [
      CommonModule,
      EnterpriseRoutingModule
    ],
  })
  export class EnterpriseModule { }
  </code></pre>
  
  <p>Routing Module</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { Routes, RouterModule } from '@angular/router';
  
  import { LandingComponent } from './pages/landing/landing.component';
  
  
  const routes: Routes = [
    {
      path: '',
      component: LandingComponent,
    }
  ];
  
  @NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
  })
  export class EnterpriseRoutingModule { }
  
  </code></pre>
  
  <p>Here is the HTML </p>
  
  <pre><code>&lt;div class="row" *ngIf="true"&gt;
            &lt;div class="col-lg-6"&gt;
              &lt;h1&gt;
                Feature Heading 1
              &lt;/h1&gt;
              &lt;p&gt;
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
                eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
                enim ad minim veniam, quis nostrud exercitation ullamco laboris
                nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                reprehenderit in voluptate velit esse cillum dolore eu fugiat
                nulla pariatur. Excepteur sint occaecat cupidatat non proident,
                sunt in culpa qui officia deserunt mollit anim id est laborum.
              &lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="col-lg-6"&gt;
              img
            &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>It's set equal to true so I could test, but obviously not working.</p>
  
  <p><strong>Update</strong>: Not sure what I did, but I went to bed, woke up and it worked, didn't change a single line of code.</p>