The Screen Orientation plugin provides the ability to set or lock the screen orientation (landscape or portrait), as well as detect when the orientation has changed.
If you have not already setup Ionic Enterprise in your app, follow the one-time setup steps.
Next, install the plugin:
advanced: Accepted orientation values:
The orientation is in the primary portrait mode.
The orientation is in the secondary portrait mode.
The orientation is in the primary landscape mode.
The orientation is in the secondary landscape mode.
The orientation is either portrait-primary or portrait-secondary (sensor).
The orientation is either landscape-primary or landscape-secondary (sensor).
Convenience enum for possible orientations
Get the current orientation of the device.
Lock the orientation to the passed value. See below for accepted values
|orientation||The orientation which should be locked. Accepted values see table above.|
Listen to orientation change event
Unlock and allow all orientations.