I have the following angular service:
.factory("OTReady", ['$document', function ($document) {
var ready = false;
$document.context.addEventListener('deviceReady', function () {
ready = true;
});
return (function(fn){
if (ready) {
fn();
} else {
$document.context.addEventListener('deviceReady', fn);
}
});
}])
And this is returning "undefined". It's a snippet from an opentok-angular library running in Cordova.
Many other $document properties are available at in this block of code. Why this is returning "undefined" ?