ng是angular的内置命令,可以在HTML文件里实现简单的 if for switch逻辑。
一:先看下ngif:
<span *ngIf="switch">xxx金额:{
{
usableBonus | number:'1.2-2'}}元; </span>
ngif; then
<div *ngIf="col.field=='useSubsidy'; then thenBlock else elseBlock " ></div>
<ng-template #thenBlock> {
{
carData.useSubsidy|USE_SUBSIDY_PIP}} </ng-template>
<ng-template #elseBlock> {