I am looking to disable all buttons, clicks, and hyperlinks while displaying a backdrop with the message "GO ONLINE". It may come off as rude, but it is necessary.
AppComponent (TS): The connectionMonitor can be used to monitor network connectivity.
private onlineObserver(){
if (isPlatformBrowser(this.platformId)) {
const offline$ = fromEvent(window, 'offline').pipe(mapTo(false));
const online$ = fromEvent(window, 'online').pipe(mapTo(true));
this.connectionMonitor = merge( offline$, online$ );
} else {
this.connectionMonitor = empty();
}
}
app.component.html : Just include the whole router-outlet.
<router-outlet></router-outlet>
Any suggestions on how to implement this in Angular 7?