我得到一个错误,它说,下面的控制台。ngif别的不AngularJs工作4
不能绑定到“ngIfElse”,因为它不是“P”的已知属性。
我给isTrue2 = false模块中。
下面是我对AngularJS 4应用程序代码。
<p *ngIf="isTrue2; else other">example</p>
<ng-template #other>
other content here...
</ng-template>
我得到一个错误,它说,下面的控制台。ngif别的不AngularJs工作4
不能绑定到“ngIfElse”,因为它不是“P”的已知属性。
我给isTrue2 = false模块中。
下面是我对AngularJS 4应用程序代码。
<p *ngIf="isTrue2; else other">example</p>
<ng-template #other>
other content here...
</ng-template>
你有没有组件的模块中导入'CommonModule'? –
仔细检查你的角度版本,大部分相关的问题我能找到是由引起的。也发布您的模块/组件,它可能是一个缺少的导入。 –
@Murhaf Sousli,我写的太快了,忘了,你也可以,如果你没有正确导入,出现此错误。我可能正考虑不能在同一个标签上同时使用* ngIf和* ngFor。 – snaplemouton