Skip to content

ngIf的时候报No provider for TemplateRef! #128

Open
@deepthan

Description

@deepthan

这是由于写法错误,首先得引入ngIf的包commonModule,之后按照下面两种写法其中任意一种即可。

<div *ngIf="bool" >
</div>

或者

<template [ngIf]="bool">
    <div></div>
</template>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions