We released the first version of ngCordova today, an open source set of AngularJS services and extensions to make using Cordova plugins in your Ionic apps incredibly easy. Read the full release info here: http://ionicframework.com/blog/ng-cordova/
If you’ve ever used a Cordova plugin but had difficulty incorporating it into your Angular code, ngCordova was made for you. Give it a try, and let us know what you think about it!
Soon, we will be adding support for mocking plugins for testing purposes (think testing Geolocation data, or simulating a device shake), and also making plugins not fail if Cordova isn’t present.
From all of us on the Ionic team, we hope you love ngCordova!
@Alexd Do you want to try and port that into ngCordova as a PR? Since the project is only a few days old and in very alpha stages, I’m sure max will accept it and it can be improved upon in the near future. The naming conventions are $cordova<<PluginName>>.
@pcr Check out the updated docs for Device Motion.
You have to first obtain the watchID like: var watchID = $cordovaDeviceMotion.watchAcceleration(options).then(...)
then use watchID in the clearWatch method.
@dimitrisplus SQLite has been added, but lacks some functionality, so maybe use it as a base for your SQLite use.
Thanks for this library; tho I’m still having trouble with it. I made a demo app based on the one included with the library; when I run it in the Android emulator I don’t even get device info (see ‘device’ page). I’ve added all the plugins and have everything referenced as I saw in the documentation. Github here:
Got it working, it appears it was the order of the scripts (cordova 1st, ngcordova 2nd) and an update to the ngcordova script itself. To create the app, I executed the following commands:
Awesome job guys I am playing around with this now
I have a question… Anyone have a gut feel as to whether or not this would be quicker than the “long way” of using Cordova plugins? Wonder if there’s any slight performance benefit here? Just curious