【发布时间】:2017-09-26 18:03:01
【问题描述】:
我终于设法加载了softsimon angular-2-multiselect-dropdown。 我如何获得选定的选项?
我正在使用 softsimon angular-2-multiselect-dropdown v 0.4.0
**编辑:**
<ss-multiselect-dropdown [options]="ArrayObject" [texts]="myTexts" [settings]="mySettings" (onModelChange)="dummy"></ss-multiselect-dropdown>
ArrayObject 是:
for(let x = 0; x < this.productArray.length ; x++ ){
let temp={id : x , name : this.productArray[x]};
this.ArrayObject[x]=temp;
}
询问的输出:
[ { "id": 0, "name": "redBox" }, { "id": 1, "name": "orangeBox" } ]
提前致谢
【问题讨论】:
-
欢迎来到 StackOverflow。请发布代码,说明您尝试完成的工作、尝试的内容以及失败的地方。
-
你为什么不只是使用
this.ArrayObject.push({id : x , name : this.productArray[x]});。如果您将<div>{{ArrayObject | json}}</div>添加到您的页面,您会得到什么?您能否也将此输出添加到您的问题中? -
@GünterZöchbauer 我会按照您的建议进行更改。我已经添加了你问的输出。
标签: angular