Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Ionic 2 with ng-cordova

$
0
0

I just spent some time on this so replying here. if you are using typescript, your editor/the build will report an error that navigator is undefined. It will work on the device though when the cordova plugin runs.

To fix this I downloaded phonegap.d.ts, which includes all the cordova interface definitions, added it to the project, and updated tsconfig.json to include:

"files": [
"app/app.ts",
"app/phonegap.d.ts"
],

that cleared up the typescript errors and gives you typing access to all the navigator attributes


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>