Here it is a code to check application is online or offline :
this.online$ = Observable.merge(
Observable.of(navigator.onLine),
Observable.fromEvent(window, 'online').map(() => true),
Observable.fromEvent(window, 'offline').map(() => false)
)
this.online$.subscribe(isOnline=>{
if(isOnline){
console.log(isOnline);
}else{
console.log("you are offline");
console.log(isOnline);
}
});
But it always return a true it means they are online but it's wrong result. I turned off system internet unlikely they return same result (true).