如何检查ngIF指令中的#id html模板?

时间:2018-01-23 13:42:29

标签: angular typescript angular-material

我在HTML模板中有列表,我在其中创建了#child的id:

 <mat-selection-list #childs>
            <mat-list-option *ngFor="let child of ELEMENT_DATA">
              <span (click)="assignChild(child)">{{ child.firstName }}&nbsp;{{ child.lastName }}</span>
            </mat-list-option>
          </mat-selection-list>

在第二阶段,我想检查* ngIf内部的长度。问题是:如何将#child传递给*ngIf=""?谢谢和问候。

格雷格

0 个答案:

没有答案
相关问题