Well if you’re using TypeScript you would need to add something like:
declare var cordova: any;
This will tell TypeScript not to worry about that strange variable that popped out of no where.
Also you should have a look at ionic-native, it’s a library that provides wrappers for most of the plugins you will need. These wrappers return back Promises and Observables instead of using callback functions. This will give you many benefits including change detection triggering in Angular 2.