问题描述
我现在有以下代码:
<ng-container *ngIf="someCondition">
<ng-template [ngIf]="cd.typedType === 'first'" [ngIfElse]="Second">
<div class="row">
first
</div>
</ng-template>
<ng-template #Second>
<div class="row">
second
</div>
</ng-template>
</ng-container>
<ng-container *ngIf="someCondition">
<ng-template [ngIf]="cd.typedType === 'first'" [ngIfElseIf]="cd.typedType === 'Second'" [ngIfElse]="cd.typedType === 'Third'>
<div class="row">
first
</div>
</ng-template>
<ng-template #Second>
<div class="row">
second
</div>
</ng-template>
<ng-template #Third>
<div class="row">
third
</div>
</ng-template>
</ng-container>
那么要使用基本的if / elseif / else在3个不同的模板之间移动吗?