I am developing android application using cordova and ionic framework,using network plugin from here (https://github.com/apache/cordova-plugin-network-information). But the device ready alert fires off and then I get the the following error.
"TypeError: Cannot read property 'type' of undefined
Here is navigator object
navigator.connection.type
I will get error in following line.
use mine
For some reason, the navigator.connection object is not ready at the same time as cordova is.
You have to use a timeout, such as this one - designed for Angular/Ionic