Access to fetch at 'http://URL' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I got the above error in console .But I have enabled the CORS in WEB API other API requests are not showing this error.
service :
ViewPDF(mMagazineId){
return this.http.get(this.BASE_URL + `/api/ViewPDF/?mMagazineId=${mMagazineId}`);
}
WebApiConfig.cs
config.EnableCors(new EnableCorsAttribute("*", headers: "*", methods: "*"));
I am really confused with this issue .Can anyone help me to solve this.