export class MyApp {
constructor (
private network: Network,
private platform: Platform,
private alertCtrl: AlertController,
) {
platform.ready().then(() => {
// no internet --> do :
this.listenConnection();
})
}
private listenConnection(): void {
this.network.onDisconnect()
.subscribe(() => {
this.showAlert();
});
}
private showAlert(): void {
// do the alert thing ...
}
}
Last active
July 20, 2018 03:10
-
-
Save Ademking/bdc6458665a938fc59fdbfa2cef3e484 to your computer and use it in GitHub Desktop.
π Ionic 3 : Test network connectivity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment