ngFor循环和ngIf循环

时间:2017-11-07 14:36:37

标签: angular typescript

我是TypeScript的初学者。我正在尝试创建一个循环来迭代我的所有系列:ngFor ="让系列的listList",并显示其模态等于' CT':ngIf =&#34 ; series.instance.modality ==' CT'

我试试这个:

<series [series]=series *ngFor="let series of seriesList; let i = index">
  <series *ngIf="series.instance.modality == 'CT'"></series>
</series>

而且:

<series [series]=series 
        *ngFor="let series of seriesList; 
        let i = index; 
        *ngIf="series.instance.modality == 'CT'">
</series>

/////////////// EDIT //////////////:

我试试这个:

<ng-container *ngIf="series.instance.modality == 'CT'">
  <series [series]="series" *ngFor="let series of seriesList; let i = index">
  </series>
</ng-container>

但这不起作用,因为如果我认为我必须在我之前做我的循环..

0 个答案:

没有答案