Currently, I am working on an AngularJS Cordova app and so far everything is progressing smoothly. My next objective is to integrate Cordova plugins into the application, specifically the Cordova Connect plugin, which will allow me to monitor network connectivity and events.
The idea is to constantly check these network events through the Connect plugin to determine if the device has an active internet connection. If not, I intend to redirect users to an error page.
I am facing a dilemma in deciding where to register these events within my AngularJS application during startup. Should I place them in the main run block, config block, or perhaps create a new factory/service/provider?
Where have others typically incorporated these non-AngularJS device events in their projects?
For example:
document.addEventListener("online", yourCallbackFunction, false);