Cordova file not defined

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?

hi,

you add browser platform ?

if not run in the cli

ionic add platform browser
then
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.