简体   繁体   中英

Angular 2 Http post run get error

Using Angular 2 Http Post run got following error.

How to solve it ?

i) GET http://127.0.0.1/traceur 404 (Not Found) zone.js:2019

ii) ZoneAwareError {__zone_symbol__error: Error: (SystemJS) XHR error (404 Not Found) loading http://127.0.0.1/traceur Error: XHR error (4....}

First of all, The error you posted shows "GET" error not "POST".

Now the question how to solve it. The compiler only detects code related issues in your application.

If you are making request to specific URL and your code implementation is correct then compiler will show no errors.

But when application runs then actually that API call is being initiated. In your case, Your application is not able to locate URL " http://127.0.0.1/traceur ", So make sure backend is working properly and application gets some data hitting that API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM