Dear Sir / Madam,
I updated our Ionic 2 project to the latest version. Within these version the whole structure is different than the old project. It seems nice, but in our ApiService I can’t use the Promise.resolve. Does anybody know how to fix this?
getCategories() {
if (this.categories.length > 0)
return Promise.resolve(this.categories);
return new Promise(resolve => {
return this.http.get(this.apiUrl + this.categoriesUrl)
.map(res => res.json())
.subscribe(data => {
this.categories = data;
resolve(this.categories);
// return this.categories;
});
});
}
The error is: Cannot find name ‘Promise’. Thank you in advance.
Kind regards,
Jelle