title: Angular2 CORS issue on localhost
body: <pre><code>Failed to load URL: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
  </code></pre>
  
  <p>Is it possible to fix this from Angular2 without changing the code in server side (Java Spring Controller)?</p>
  
  <p>My code</p>
  
  <pre><code>const headers = new Headers({'Content-Type': 'application/json',
      'Access-Control-Allow-Origin' : '*'
  });
  return this.http.get(url, {headers: headers})
    .toPromise()
    .then(response =&gt; response.json().data as Hero[])
    .catch(this.handleError);
  </code></pre>