I have an AngularJS Cordova application, and right now everything is going well. My next step is to add Cordova plugins to an application, such as the Cordova Connect plugin, to check if the network connection is turned on and listen to network events.
The plan is to listen to these network events and request the Connect plugin, if the device has an Internet connection, if not, I will be redirected to the error page.
I am trying to find a place in my AngularJS application where to log these events when the application starts.
Should they be in the main startup block, configuration block, or inside any factory / service / provider?
Where do you guys put these external devices on AngularJS devices?
FX
document.addEventListener("online", yourCallbackFunction, false);
source share