I created a blank
project in ionic. In the www/js/app.js
with the following code:
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);
console.log("works!");
}else {
console.log("nopes");
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
});
I always get nopes
in the console. Why is that so? Why is window.cordova
undefined?