Angular 物化ECSS多重选择角度2无点火变化
使用Angular 物化ECSS多重选择角度2无点火变化,angular,materialize,Angular,Materialize,使用materialiecss“多选”不会触发change。当select更改时,如何绑定方法 以下代码不会发生更改 HTML <select id="booger" multiple> <option value="1">{{articleIdLabel}}</option> <option value="2">{{articlePubDateLabel}}</option> <option value=
materialiecss
“多选”不会触发change
。当select更改时,如何绑定方法
以下代码不会发生更改
HTML
<select id="booger" multiple>
<option value="1">{{articleIdLabel}}</option>
<option value="2">{{articlePubDateLabel}}</option>
<option value="3">{{articleTitleLabel}}</option>
<option value="4">{{articleViewDateLabel}}</option>
</select>
我可以通过对代码进行以下更改来解决此问题:
Component
ngAfterViewInit() {
$("#booger").material_select(this.change.bind(this));
}
change() {
console.log("change");
}
使用此代码。它对我有用
<div class="input-field col s12">
<select formControlName="status" [(ngModel)]="selectedStatus" materialize="material_select">
<option [ngValue]="" disabled>Select</option>
<option [ngValue]="1">Enable</option>
<option [ngValue]="0">Disable</option>
</select>
<label>Status</label>
</div>
挑选
使可能
使残废
地位
嘿,@prolink007我能够在我的项目中实现这一点,非常感谢!。我陷入了需要获取当前所选选项的值的情况。我将如何继续这样做,任何指针都会有帮助。提前谢谢!
<div class="input-field col s12">
<select formControlName="status" [(ngModel)]="selectedStatus" materialize="material_select">
<option [ngValue]="" disabled>Select</option>
<option [ngValue]="1">Enable</option>
<option [ngValue]="0">Disable</option>
</select>
<label>Status</label>
</div>