我有两个 md 选择:
<form (ngSubmit)="someAction(f)" #f="ngForm">
<md-select
#selectedHolidayType
placeholder="Holiday type"
name="holiday_type"
[(ngModel)]="holiday_type"
>
<md-option *ngFor="let type of types" [value]="type.typeId">{{ type.typeName}}</md-option>
</md-select>
<md-select
*ngIf="selectedHolidayType === 19"
placeholder="Some placeholder"
name="option"
[ngModel]="option"
>
<md-option *ngFor="option of options" [value]="option.id">{{option.value}}</md-option>
</md-select>
</form>
仅当第一个 md-select 选定值设置为我想要的值时,我如何才能显示第二个 md-select,在这种情况下为 19。
或者也许:如何在 html 模板中获取第一个 md-select 的选定值?
我已经尝试过:
*ngIf="holiday_type === 19"
*ngIf="selectedHolidayType.selected === 19"
*ngIf="selectedHolidayType.selected.value === 19"
但这些都不起作用。
谢谢你的帮助!