$cordovaDeviceMotion working example


#1

Can anyone provide this form me. I have found examples using phonegap but not ionic. It can be as simple a firing a console log when a shake is detected. I would also like to perform different things when the shake is detected depending on what view the user is in.

Thanks


#2

Give me 2-3 hours and I will write you a working example.


#3

I wrote a tutorial for you, find it below.

###Click here.

You will need to modify it a bit so it can work in different views. Create service/factory, move device motion code there and trigger it on view level.