Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49526

Ionic 3 how to handle live api

$
0
0

@paulbuscano003 wrote:

Hi, How can I handle live changing api url (raw data instead of json)?

below is my example ionic code.

  //test live
  getLive(){ 

      if (this.platform.is('mobile')) {
        this.lets = "https://live.wh.geniussports.com/v2";
      } else {
        this.lets = "/v1";
      }
  
      this.http.get('https://live.wh.geniussports.com/v2/basketball/read/987129?ak=eebd8ae256142ac3fd24bd2003d28782')
      .map(res => res.json())
      .subscribe(data => {
        this.dataLive = data.response;  
  
        console.log(this.dataLive, 'oblack');
      }, err => {
        console.log(err); 
      });
  
  }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49526

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>