# Class: DeviceOrientation

## DeviceOrientation

#### new DeviceOrientation(options)

  Handle device orientation change

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---

  `options`

  Object

  ###### Properties

  Name | Type | Description
  --- | --- | ---
  `onOrientationChange` | DeviceOrientation_Callback |

  ##### Example

      let ori = new DeviceOrientation({
          onOrientationChange: orientationName => {
              console.log(orientationName)
          }
      })

      // Get current orientation
      let orientationName = ori.getOrientation()

      // Remove event binding
      ori.off()

### Methods

#### getOrientation()

  Return the current normalized orientation

  ##### Returns:

  landscape-primary, portrait-primary, landscape-secondary, portrait-secondary
  Type
    String

#### off()

  Remove all binding

  ##### Returns:

  Type
    DeviceOrientation

### Type Definitions

#### DeviceOrientation_Callback(type)

  Called when the orientation of the device change

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `type` | String | Name of the orientation: landscape-primary | portrait-primary | landscape-secondary | portrait-secondary

#### Search results