I can not communicate with my api in the server
i get this message error
no ‘access-control-allow-origin’ header is present on the requested resource
Login.ts
public login() {
this.showLoading()
this.auth.login(this.registerCredentials).then((result) => {
this.nav.setRoot(HomePage);
}, (error) => {
this.showError(error);
});
}
auth.ts (login Service)
login(credentials){
return new Promise((resolve, reject) => {
let headers = new Headers();
this.http.post(apiUrl , JSON.stringify(credentials), {headers: headers}).
subscribe(res =>{
resolve(res);
}, (err) =>{
reject(err);
});
});
}