我想检查实际元素是否有值。Angular2 - ngIf in ngFor
例如,我想检查巧克力是黑色还是白色。根据这个,我想显示正确的文本。
<ng-container *ngFor="let chocolate of product.getChocolates();">
<md-card *ngIf="chocolate.getName() == black">IT IS BLACK</md-card>
<md-card *ngIf="chocolate.getName() == white">IT IS WHITE</md-card>
</ng-container>
如何修复代码,使其工作?
复制错误....但那不是我正在寻找的答案:) – ALSTRA