我想在这样的代码来实现ngSwitch
ngSwitch默认情况下:不执行
<div [ngSwitch]="accessLevel">
<div class="customer" *ngSwitchCase="ENABLED">
This is customer data
</div>
<div *ngSwitchDefault>
this is default
</div>
<div class="customer-blurr" *ngSwitchCase="DISABLED">
This is disabled Customer Data
</div>
</div>
在我的情况accessLevel
是不确定的,我期待this is default
,但它显示:
This is customer data.
This is disabled Customer Data.
由于我从the official docs读取,如果没有匹配,它应该去默认情况下。我错过了什么吗?
非常好。谢谢 – Roxy