Error when querying API in Angular

0

Good morning, I'm trying to access my API by angular through the get of the http module, my files are in my github repository if someone wants to take a look. I'm following this tutorial here to make the request, but always gives the following error:

ERROR in node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'. src/app/app.component.ts(2,10): error TS2305: Module '"/home/danielhgimenez/app-test/node_modules/rxjs/Observable"' has no exported member 'Observable'. src/app/app.component.ts(3,27): error TS2307: Cannot find module 'app/pacoteAPI'. src/app/app.component.ts(4,28): error TS2307: Cannot find module 'app/app.service'. src/app/app.component.ts(18,3): error TS2663: Cannot find name 'dados'. Did you mean the instance member 'this.dados'? src/app/app.service.ts(4,10): error TS2305: Module '"/home/danielhgimenez/app-test/node_modules/rxjs/Observable"' has no exported member 'Observable'. src/app/app.service.ts(17,14): error TS2339: Property 'map' does not exist on type 'Observable<Response>'.

I do not know how to solve this problem. Apparently it's caused by the fact that I'm using the latest version of the angular and needs this compatibility library, or it was removed in the new version (I'm not sure). I had "managed to fix" (if you understand me) by installing the npm install rxjs@6 rxjs-compat@6 --save packages and using the npm audit fix --force command to fix the installation errors, but still continued to give error. p>

All I need is to make a get request on a localhost server that will return a JSON, get the json data, and display on the screen. I accept any suggestions for solving the problem, and thank you for linking to a newer article or for better teaching a request.

From now on, thank you for your attention:)

    
asked by anonymous 01.06.2018 / 18:38

0 answers