I’m trying to make an “upload” button in my app hide or show based on the device’s network connectivity. I have the following code:
let deviceConnectedToInternet = this.network.onConnect().subscribe(ret => {
this.deviceConnected = true;
});
let devicedisconnectedFromInternet = this.network.onDisconnect().subscribe(ret => {
this.deviceConnected = false;
});
If I put a console.log in the arrow function, I can see that the observable is correctly triggering when the network connects or disconnects, and my boolean value is changing. But the view isn’t updating to reflect that change.
Any help is appreciated.