use the below method in your app.components.ts
if (this.network.type == "none") {
this.checkNetwork("offline");
}
Observable.merge(this.network.onConnect(), this.network.onDisconnect())
.subscribe(e => this.checkNetwork(e.type), err => console.error(err));
checkNetwork(e) {
if (e == "online") {
this.loadingPopup.dismiss();
this.createLoading();
this.isOnline = true;
} else {
this.loadingPopup.present();
this.isOnline = false;
}
}