how to make my app don’t display the error if the respond i empty?
I’m getting a list of array
my ts code
this.Http.get(this.url ).subscribe((response) => {
this.areas = response.json();
console.log(response)
loadArea2.dismiss()
if(this.areas.length !> 0){
console.log('empty')
let noarea2 = this.AlertController.create({
title: 'Sorry',
subTitle: 'No Areas in Your City',
buttons: ['OK']
});
noarea2.present();
}
});
i want to don’t display this error and display the alert message