You can fix this by checking if you are using
http vs https
Just use http to fix it. After that, Add that in the header in the angular service you created like doing a code like this
const httpOptions = {
headers: new HttpHeaders({
'Access-Control-Allow-Origin': 'http://localhost:4200', // -->Add this line
'Access-Control-Allow-Methods': 'GET,PUT,POST,DELETE,OPTIONS',
'Access-Control-Allow-Headers': '*',
'Content-Type': 'application/json',
'Accept': 'application/json'
})
};
Just check the string value you passed in your code.
Sometimes your eye gets trick on these values. Like
http://localhost:4200 vs https://localhost:4200
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…