I am trying to extend my ionic app with the https://github.com/apache/cordova-plugin-file
but I keep getting
ReferenceError: cordova is not defined
in Chrome where I develop when I try to run
$cordovaFile.checkFile(cordova.file.dataDirectory, “aFile.json”).then(function (success) {
console.log(success);
}, function (error) {
console.log(“myService - failed to check file exists”);
});
However, $cordovaFile is defined and the documentation states that browsers are supported. Could it be I am not catching the onDeviceReady event?