how to make a sidemenu tab accessible only when connected to the internet
When you check navigator.onLine
, it will give a boolean value true
, if you are connected to the internet. If you are offline, then it will return false
. Based on this value you can just show or hide the side menu button.
You can either take variable on the $rootScope
or you can check the value in each route, and make the manipulations to show or hide the side menu.
yeah and you need maybe this plugin:
you get two events “online” “offline” to react if the device goes offline during usage and so on.
so you can set a flag --> if offline and avoid opening sidemenu
thanks you…