我从http响应中获取了更新数据,并设置为列表,但是视图未显示更新数据。
getChartFilterData(reqData) {
this.httpService.get(UrlDetails.$getChartFilterData, reqData)
.subscribe(response => {
this.datas.forEach(element => {
if (element.graphCode == reqData.graphCode) {
element.data = response.responseData.data.body.pulseData[0].data;
}
});
}, (error) => {
});
}
这是我的html代码。在这种情况下,我使用图形来设置数据中的数据。
<div class="col-xs-12 col-sm-12 col-md-6 marbtm10" *ngFor="let data of datas;let i = index;let last=last;">
<md-card class="widget-card">
<div class="widget-card-inner">
<div class="widget-heading pull-left">{{data.graphTitle}}</div>
<div class="chart-info">
<div class="full-width-input-wrap select-box-wrap pull-right" *ngIf="data.graphTitle === 'Jobs'">
<md-select class="no-mar-top" [ngModel]="selectedDocScanVolType" (change)="onFilterTypeChange($event)">
<md-option *ngFor="let val of DocScanVolFilter" [value]="val.value">
{{val.name}}
</md-option>
</md-select>
</div>
</div>
<app-charts [type]="data.graphType" [data]='data.data' [options]="data.options" [isChatTypeSupported]="data.isTypeSupported"></app-charts>
</div>
</md-card>
</div>