Does $cordovaNetwork have to be wrapped inside $ionicPlatform.ready()?

Does $cordovaNetwork have to be wrapped inside $ionicPlatform.ready(function() { ... } ) or document.addEventListener("deviceready", function () { ... } ); I just want to make sure.

The ngCordova documentation has document.addEventListener("deviceready", function () { ... } ); as an example and from what I’ve read from other forums and QA sites, the only way others have made it work was to wrap it around any of the two mentioned above. I just want to make sure because it doesn’t make sense to me to do this.

If anyone has other ways to go about it, please share.

$ionicPlatform.ready and document.addEventListener("deviceready", are the same thing. The ionic one is just to scope things in angular land.

1 Like