Search code examples
angularangular-ng-if

Can't bind to 'ngIf'


Can't bind to ngIf since it isn't a known property

<AddWrkFrcePopUp *ngIf="showWrkFrcePop === true" (closeWrfFrcePop)="_closeWrkFrcePop()">
</AddWrkFrcePopUp>

Solution

  • If you are using RC5 then import this:

    
        import { CommonModule } from '@angular/common';  
        import { BrowserModule } from '@angular/platform-browser';
    
    

    and be sure to import CommonModule from the module that is providing your component.

    @NgModule({
       imports: [CommonModule],
       declarations: [MyComponent]
       ...
     })
    class MyComponentModule {}