Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 物化ECSS多重选择角度2无点火变化_Angular_Materialize - Fatal编程技术网

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>