Я решил проблему, получив значения из localStorage в компоненте страницы и передав его в службу API.
constructor(private AuthService: DubaiService,
public loadingController: LoadingController,
public storage: Storage,
private SettingsAuth :SettingsService,
public modalController: ModalController) {
this.showLoader()
Promise.all([this.storage.get("cat"),
this.storage.get("loc"),
this.storage.get("serv")]).t hen(values => {
this.usercategory = values[0];
this.userlocation = values[1];
this.userservice = values[2];
console.log(values)
})
}
ionViewDidEnter(){
this.AuthService.getListings(this.usercategory,this.userlocation,this.userservice)
.subscribe((data) => {
console.log(data);
this.listing_items = data,
err => console.log(err);
this.hideLoader()
,
() => console.log("done");
this.hideLoader();
});
}
и метод My API Call:
getListings(usercategory,userlocation,userservice){
return this.http.get(this.url + "&location=" + userlocation +
"&price=" + usercategory + "&service=" + userservice);
}