0

我正在尝试显示来自 API 的数据。

我正在做的是:

var qstring = ['http://localhost:57398/api/values/passdata?query=select * from t1 order by id offset 0 rows fetch next 1000 rows only', 'http://localhost:57398/api/values/passdata?query=select * from t1 order by id offset 1000 rows fetch next 1000 rows only', 'http://localhost:57398/api/values/passdata?query=select * from t1 order by id offset 2000 rows fetch next 1000 rows only', 'http://localhost:57398/api/values/passdata?query=select * from t1 order by id offset 3000 rows fetch next 1000 rows only'];

return Observable.from(qstring).mergeMap(d => this.http.get(d).map(res => res.json() as any));

绑定

source: any;

 this.service.getDataFromServer().subscribe(data => {
            this.source = this.sdata;
        }, Error => {
            console.log(Error);
        });

模板

 <ng2-smart-table [settings]="settings" [source]="source" ></ng2-smart-table>

但它只显示最后一个。如何确保附加数据而不是覆盖数据?

4

0 回答 0