Here is the complete code snippet:
this.http.post(link, data, { headers: headers })
.map(res => res.json())
.subscribe(data => {
this.data.response = data._body;
}, error => {
console.log("Oops! An error occurred");
});
Upon running the code, the following error message is displayed:
"XMLHttpRequest cannot load
https://script.google.com/macros/s/AKfycbzdHHKBmLWJYZtFGlJGOrUwlPIWXor1geEOgcSgvhs/dev.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:8100' is therefore not allowed access.
The response had an HTTP status code of 401."
I have tried looking into CORS but it's still unclear to me...
Any assistance in resolving this issue would be highly appreciated.