【发布时间】:2019-08-16 19:38:19
【问题描述】:
我正在查询 API 并将数据返回到数组中。我不确定如何从 API 返回的数据响应中设置选择/下拉框的数据源。我的模型类是
export class sProject {
Id: string;
prj_number: string;
emp_number : string;
}
我的组件是这样的
export class RFComponent implements OnInit {
sList: sProject[];
entityUrl = 'sDetail/GetByRP?Prj=345';
constructor(service: DataService) {
service.get<sProject[]>(this.entityUrl).subscribe(x =>
{this.stList = x });
}
ngOnInit() { }}
数据在sList 数组中,我不确定如何为我的选择/下拉框设置数据源
<div class="dx-fieldset">
<div class="dx-field">
<div class="dx-field-label">ShipTo Account</div>
<div class="dx-field-value">
<dx-select-box></dx-select-box>
</div>
</div>
</div>
我在这里使用的是 devextreme 库,我试图在下拉框中查看所有 prj_number。
【问题讨论】:
标签: angular angular7 devextreme