@nbelghiti wrote:
page user.ts
getUsers() { this.rest.getUsers() .then(data => { this.users = data; console.log(data) }, err =>{ this.erreur = err; console.log(err); }); }
provider rest
getUsers() {
return new Promise((resolve, reject) => {
this.http.get(this.apiUrl+’/accueil’).subscribe(data => {
resolve(data["_body"]);
console.log(data);
}, err => {
reject(err);
console.log(err);
});
});
}erreur
Failed to load https://www.aef.info/api/Testapi/accueil: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100’ is therefore not allowed access. The response had HTTP status code 401.
Posts: 2
Participants: 2