Cordova Device Motion

Hi Guys,

Im trying to implement this Device motion( ) but this error happens


.controller('ShakeAccelerationCtrl', function($scope, ngFB, **$cordovaDeviceMotion**) { ..});


Error: [$injector:unpr] Unknown provider: $cordovaDeviceMotionProvider <- $cordovaDeviceMotion <- ShakeAccelerationCtrl

Someone know whats happening? I already installed this plugin but $cordovaDeviceMotion is not be found.


Have you checked in console that your app loaded these 2 files: Acceleration.js and accelerometer.js?
Installation cuold have failed to copy them.

Hi gmarziou,

Thanks for your response.

I install using cordova command cordova plugin add cordova-plugin-device-motion and it says is already installed…

I check on tree files and i can see on plugin dir cordova-plugin-device-motion. Should I modify some file to activate this plugin??



Oh I got it…

I forgot to instal ngCordova… Dumb mistake.

Thanks so much to your help.

Do we need to install ngCordova in ionic 2… cox I am able to use other native plugins but not able to use device motion or shake