1. 程式人生 > >Angular2/4_ select多選元件,支援搜尋

Angular2/4_ select多選元件,支援搜尋

此元件支援 響應式表單和模板驅動式表單

    支援關鍵詞搜尋

    支援分組

    支援多選

官網地址:http://cuppalabs.github.io/components/multiselectDropdown/#Getting-Started

個人資料來源返回:

this.poService.getLanceCodes(workstationCode).subscribe((r) => { this.lanceCodes = r.map((item: any) => { return { id: item.value, itemName: item.key} }); });

遇到過的坑:

    1. setting必須早點實現。不然會出bug

    2. 搜尋支援中文。格式如上即可

    3. 名字好像必須是 id => itemName 看他的原始碼是這樣的。 具體自測。

 正在趕專案,沒時間詳細寫。