I have a problem that I can't seem to figure out. I want to send a http params request from my Angular client to server using below code but I am getting exception:
http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass
I want clarity about it, did I make any mistakes in Angular or is this a server side problem?
Auth:
login(username: string, password: string) {
let params = new HttpParams();
params = params.append('email', username);
params = params.append('password', password);
return this.http.post<any>('URL',{params:params})
.pipe(map(user => {
if (user && user.token) {
}
}),
catchError(this.handleError)
);
}