This line when included in controller works normally but when I include it in a factory, the app does not open. There is only a white screen.
The error I am getting from Logcat is:
D/CordovaLog( 4176): file:///android_asset/www/lib/ionic/js/ionic.bundle.js: Line 19387 : TypeError: Cannot read property 'externalDataDirectory' of undefined
Apparently, cordova.file remains undefined in a factory even when window.cordova is defined. Any ideas why this must be happening?
I am testing out on Android.