title: Can't bind to 'ngIf' since it isn't using CommonModule?
body: <p>I get this message:</p>
  <pre><code>Can't bind to 'ngIf' since it isn't a known property of 'div'.
  </code></pre>
  <p>So, all components that I use were declared in shareModule.</p>
  <pre><code>@NgModule({
      imports: [
          CommonModule
      ],
  
        declarations: [
          BlockComponent,
          FieldComponent],
  
  exports: [
   BlockComponent,
          FieldComponent
  ]
  
  });
  </code></pre>
  <p>So, when <code>BlockComponent</code> is rendered this error message appears. Why if I imported <code>CommonModule</code></p>
  <p>But sometimes it works, sometimes not...</p>
  <p>Angular 10.</p>
  <p>Main component <code>app-document-form-node</code> that reused in recursion is:</p>
  <pre><code>&lt;ng-container *ngIf=&quot;block.type === fielType.Block&quot;&gt;
      &lt;app-block [block]=&quot;block&quot; [parent]=&quot;parent&quot; [show]=&quot;true&quot;&gt;&lt;/app-block&gt;
  &lt;/ng-container&gt;
  </code></pre>
  <p><code>BlockComponent</code> is:</p>
  <pre><code>&lt;div class=&quot;document-block&quot;&gt;
      &lt;div class=&quot;document-block__title&quot; (click)=&quot;toggle()&quot; *ngIf=&quot;block.title&quot;&gt;
          {{ block.title }}
          &lt;span class=&quot;pull-right&quot; (click)=&quot;remove($event)&quot; *ngIf=&quot;block?.remove&quot;&gt;&lt;i class=&quot;fa fa-times fa-sm pr-1&quot;&gt;&lt;/i&gt;&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class=&quot;document-block__body&quot; *ngIf=&quot;show&quot;&gt;
          &lt;ng-container *ngIf=&quot;block.tag === 'ADRESATS'&quot;&gt;
              &lt;app-adresat-list [parent]=&quot;block&quot; [adresats]=&quot;block.children&quot;&gt;
                  &lt;ng-container *ngTemplateOutlet=&quot;children; context: { block: block }&quot;&gt; &lt;/ng-container&gt;
              &lt;/app-adresat-list&gt;
          &lt;/ng-container&gt;
  
          &lt;ng-container *ngIf=&quot;block.tag === 'ADRESAT'&quot;&gt;
              &lt;app-adresat [block]=&quot;block&quot;&gt;
                  &lt;ng-container *ngTemplateOutlet=&quot;children; context: { block: block }&quot;&gt; &lt;/ng-container&gt;
              &lt;/app-adresat&gt;
          &lt;/ng-container&gt;
  
          &lt;ng-container *ngIf=&quot;block.tag === 'WORD_SETTINGS'&quot;&gt;
              &lt;app-word-settings [element]=&quot;block&quot;&gt;
                  &lt;ng-container *ngTemplateOutlet=&quot;children; context: { block: block }&quot;&gt; &lt;/ng-container&gt;
              &lt;/app-word-settings&gt;
          &lt;/ng-container&gt;
  
          &lt;ng-container *ngIf=&quot;block.tag === 'PARAMETERS'&quot;&gt;
              &lt;app-parameters [element]=&quot;block&quot;&gt;
                  &lt;ng-container *ngTemplateOutlet=&quot;children; context: { block: block }&quot;&gt; &lt;/ng-container&gt;
              &lt;/app-parameters&gt;
          &lt;/ng-container&gt;
  
          &lt;ng-container *ngIf=&quot;block.tag === 'GENERICPARAMETERS'&quot;&gt;
              &lt;app-document-parameters [element]=&quot;block&quot;&gt;
                  &lt;ng-container *ngTemplateOutlet=&quot;children; context: { block: block }&quot;&gt; &lt;/ng-container&gt;
              &lt;/app-document-parameters&gt;
          &lt;/ng-container&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;ng-template #children let-block=&quot;block&quot;&gt;
      &lt;ng-container *ngIf=&quot;block?.children&quot;&gt;
          &lt;ng-container *ngFor=&quot;let child of block.children&quot;&gt;
              &lt;app-document-form-node [parent]=&quot;block&quot; [block]=&quot;child&quot;&gt;&lt;/app-document-form-node&gt;
          &lt;/ng-container&gt;
      &lt;/ng-container&gt;
  &lt;/ng-template&gt;
  </code></pre>
  <p>As you can see main block is reused recursive if children exist in template above:</p>
  <pre><code>&lt;ng-template #children let-block=&quot;block&quot;&gt;
  </code></pre>
  <p>I have found line where it is failed:</p>
  <pre><code>&lt;div class=&quot;document-block__body&quot; *ngIf=&quot;show&quot;&gt;
  </code></pre>