Skip to content

NeoLSN/cordova-plugin-gyroscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova Gyroscope Plugin

Description

This project's idea is inspired from these two projects.

This project is merged by those two projects, and also provided an Angular module called deviceGyroscope.

Installation

cordova plugin add [email protected]

Usage

API

var gyroscope = navigator.gyroscope;
gyroscope.getCurrent
gyroscope.watch
gyroscope.clearWatch

For Angular

  1. Copy deviceGyroscope.js to your project folder.
  2. Add deviceGyroscope as a module.
angular
  .module(
    'app', [
      ... other modules
      'deviceGyroscope'
    ]
  )
  1. Inject $deviceGyroscope in controller. It's return a promise.
$deviceGyroscope.getCurrent()
$deviceGyroscope.watch()
$deviceGyroscope.clearWatch()

About

Cordova Device Gyroscope Plugin

Resources

Stars

Watchers

Forks

Packages

No packages published