I added an if conditional in my subscribe() function where I used return; to break if it meets the condition. However, instead of breaking the entire big function, it only breaks the subscribe() function and continues to execute the navCtrl.push line. How can I fix this issue?
grabInfo(){
this.ServiceProvider.grabRAW(this.email).subscribe(data => {
this.infoList = data.data;
if (this.infoList == null){
loader.dismiss();
toast.present();
return;}
//console.log(this.infoList);
this.navCtrl.push(ResultPage,{infoList: this.infoList});
}
);
}