Framework Best Practice - Cordova Plugins



Would it be possible for one of the Ionic team to blog a best practices using Ionic with Cordova and PhoneGap?

I’m struggling with the best approach to take here.

I currently use PhoneGap build but it doesn’t appear to see the config.xml file or the plugins that I have installed via the Cordova CLI and as a result my deployed app doesn’t see the plugins. Everything appears to work fine through the emulator.

I’m using the device plugin and I’m able to get device specific data via the emulator, but when deploying my app to a device, I get errors "Can’t find variable: device’.




Hey @furrm, good idea.

A tricky part about using cordova plugins with angular is making sure things are defined correctly and that the vanilla js of the cordova plugin plays well with angular. This is why we created ngcordova

Which makes working with cordova plugins much simpler.

Hope this helps :smile:


Thanks for the reply.

I’ve been looking at ngCordova and it looks very promising. I understand that the ng wrappers for the Cordova plugins are at the early stages of development and not yet fully implemented. Is that correct?

On another note, and mentioned in my previous post, do I need to update the config.xml on the root of my project when adding plugins? PhoneGap build doesn’t appear to pick up on the fact that plugins are installed. It also appears to ignore other properties from the config.xml such as app and etc?


I’m really keen on getting a content managed prototype app ready by next week so any help would be much appreciated.



ngcordova is ready for use, though the project is on going to make wrappers for any plugin out there.

As far as updated the config.xml, you don’t need to do that everytime you add a plugin. Cordova has a command called cordova prepare which updates any platform projects you have and updates the config file in there.