How to convert Observable to array[]

后端 未结 4 1776
暗喜
暗喜 2020-12-05 04:13

I have following method in typescript, I need to bind to angular grid

CountryService

GetCountries()  {
  return this.http.get(`http         


        
4条回答
  •  借酒劲吻你
    2020-12-05 04:59

    This should work:

    GetCountries():Observable  {
      return this.http.get(`http://services.groupkt.com/country/get/all`)
        .map((res:Response) => res.json());
    }
    

    For this to work you will need to import the following:

    import 'rxjs/add/operator/map'
    

提交回复
热议问题