I have problems in $ cordovaNetwork.
Always appears the error:
TypeError: Cannot read property ‘type’ of undefined
My app.js
angular.module(‘starter’, [‘ionic’,‘ngCordova’])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.controller(‘MyCtrl’, function($scope, $cordovaNetwork) {
var type = $cordovaNetwork.getNetwork();
Hi.
Have same trouble…, work fine with ionic serve on browser on device (android 5.0.1) throw this.
$cordovaNetwork used like:
$scope.isOnline = $cordovaNetwork.isOnline();
…
ngCodrova included in index.html before cordova.js etc.
ngCordova v0.1.12-alpha
ionicframework v1.0.0-beta.14
As suggested here on stackoverflow, ripple does not have an in-browser keyboard simulator, so once you upload your app to the device, error will be gone.
For “in-browser testing”, just comment out the section which checks if keyboard is shown