Cordova file not defined

I am trying to extend my ionic app with the

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) {
}, 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?


you add browser platform ?

if not run in the cli

ionic add platform browser
ionic run browser

Yes, I had it but first it didnt work, but now does after re-building it. Thanks. However, my next problem is that debugger runs the function, but neither of both console.logs fires. Breakpoints at both log calls do not catch, either.