Created
September 10, 2019 12:03
-
-
Save rajaramtt/9c507e87f6b82105f1cb4a3caa0f622f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public onlineOffline: boolean = navigator.onLine; | |
constructor(.......) | |
................ | |
................ | |
ngOnInit() { | |
window.addEventListener('online', () => { | |
this.onlineOffline = true; | |
}); | |
window.addEventListener('offline', () => { | |
this.onlineOffline = false; | |
}); | |
} | |
............... | |
............... | |
<mat-card *ngIf="!onlineOffline" class="internet-error"> | |
No Internet connection. Please connect to the Internet and try again. | |
</mat-card> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment