getCars() {
var params_list = {
param1: 1, // 1 - ID параметра
param2: 2,
param3: 3,
...
paramN: N
}
for(var key in params_list){
this.authHttp.get(APP_SERVER + '?car_param=' + params_list[key])
.map( (response: Response) => response.json() )
.subscribe(
(data) => {
data["name"] = key;
this.carsParams.push(data);
},
(error) => {
console.log('error');
}
);
}
}
getCars() {
var params_list = {
param1: 1, // 1 - ID параметра
param2: 2,
param3: 3,
...
paramN: N
}
for(let key in params_list){
this.authHttp.get(APP_SERVER + '?car_param=' + params_list[key])
.map( (response: Response) => response.json() )
.subscribe(
(data) => {
data["name"] = key;
this.carsParams.push(data);
},
(error) => {
console.log('error');
}
);
}
}