I tried this way too, but still receiving same error again. here is solution
https://techdaytodayissue.blogspot.com/2025/01/how-to-resolve-cors-issue-in-angular-12.html