These are chat archives for AngularClass/angular2-webpack-starter

10th
May 2016
Jyothi lakshmi R
@Jyothi406
May 10 2016 09:47
Hi, can any one help me in this,
console error: "XMLHttpRequest cannot load https://api.uber.com/v1/products?latitude=37.7759792&longitude=-122.41823. Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response." and please explain me how to do http header authentication in angular2
Attila Egyed
@tsm91
May 10 2016 09:52

the error you get has something to do with cors. i never used uber api before, try to search on the web http://stackoverflow.com/questions/8685678/cors-how-do-preflight-an-httprequest

for ng2 authentication try https://www.npmjs.com/package/angular2-jwt also if you are not in a hurry read https://medium.com/@blacksonic86/authentication-in-angular-2-958052c64492#.69wcuux91

this is for frontend, you also need to implement the backend counterpart

Mathijs Segers
@msegers
May 10 2016 11:52
@Jyothi406 I'm pretty sure they don't allow API requests through js then if that header is not available. I'd suggest wrapping it in another server side API or figure out if they have a solution for that problem (It is not an angular issue).
Blackbaud-PatrickOFriel
@Blackbaud-PatrickOFriel
May 10 2016 14:35
Do y'all happen to know of any good examples of using Webpack in an application with Angular 1 and 2 (using ngUpdgrade)?