Property binding ngif not used by any directive on an embedded template

前端 未结 2 586
醉话见心
醉话见心 2021-02-12 19:36

I am creating a simple application in Angular (Angular2 RC4) and I\'m finding it difficult to run the application with the live server in nodejs.

I would like to aid as

2条回答
  •  情歌与酒
    2021-02-12 20:27

    You should import the CommonModule either in the root module (AppModule), or in the module that you want to use *ngIf in (e.g. TestModule).

    import { CommonModule } from "@angular/common";
    ...
    @NgModule({
        imports: [CommonModule]
        ...
    })
    export class AppModule { }
    

提交回复
热议问题