Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Property 'subscribe' does not exist on type 'void'

$
0
0

@Shashanksr wrote:

Hi Team,

filter(value) {
    this.loading.show();//shows loading circle
    this.videos = [];//defines this.videos as an empty array
    let temp = this.ytProvider.getVideos(value);//defines temp as our http call in yt provider
    //we subscrive to videos of category value here    
    temp.subscribe(data => {
      data.forEach(res => {
        //if video is not present in videos array, we push it into the array
        if (this.videos.indexOf(res) == -1) {
          this.videos.push(res);
        }
      });
      this.loading.hide();// hides loading circle
    }, err => {
      //shows error alert if there is an issue with our subscription
      let alert = this.alertCtrl.create({
       
        message: JSON.stringify(err),
        buttons: ['OK']
      });
      this.loading.hide();//hides loading circle
     
    });
  }

Here I am getting this error.
Property ‘subscribe’ does not exist on type ‘void’.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



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