I finished successfully the angular2 \"tour of heroes\" starter tutorial. Then I build an api based on symfony3, FosRestBundle and BazingaHateoasBundle as backend. Now nearl
My fault!
after reading https://github.com/angular/angular/issues/5237 and http://www.aaron-powell.com/posts/2013-11-28-accessing-location-header-in-cors-response.html, I recognize that there must be something wrong with my CORS configuration of the NelmioCorsBundle (https://github.com/nelmio/NelmioCorsBundle/issues/9).
As a quick&dirty fix I added expose_headers: ['Origin','Accept','Content-Type', 'Location'] to the symfony configuration:
Before:
nelmio_cors:
paths:
'^/api/':
allow_credentials: true
origin_regex: true
allow_origin: ['*']
allow_headers: ['Origin','Accept','Content-Type', 'Location']
allow_methods: ['POST','GET','DELETE','PUT','OPTIONS']
max_age: 3600
After:
nelmio_cors:
paths:
'^/api/':
allow_credentials: true
origin_regex: true
allow_origin: ['*']
allow_headers: ['Origin','Accept','Content-Type', 'Location']
allow_methods: ['POST','GET','DELETE','PUT','OPTIONS']
expose_headers: ['Origin','Accept','Content-Type', 'Location']
max_age: 3600
And now it works like a charm.
So it is not an angular issue and was never really solvable. Sorry! I will keep this for everyone who stumbled over a similar CORS problem.
Many thanks to all who contributed