Angular 6 accessing REST failing with Access-Control-Allow-Origin
The Issue is not related to angular itself, but the the web server you are using.
The angular http client request always have a preflight request with type options before hitting the actual request.
you might need to add OPTIONS request method to this line
.header("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT")