Angular HTTP GET with TypeScript error http.get(…).map is not a function in [null]

前端 未结 19 2497
时光取名叫无心
时光取名叫无心 2020-11-22 03:36

I have a problem with HTTP in Angular.

I just want to GET a JSON list and show it in the view.

Service class

im         


        
19条回答
  •  太阳男子
    2020-11-22 04:12

    I have a solution of this problem

    Install this package:

    npm install rxjs@6 rxjs-compat@6 --save
    

    then import this library

    import 'rxjs/add/operator/map'
    

    finally restart your ionic project then

    ionic serve -l
    

提交回复
热议问题