when i rotate the screen in both direction portrait and landscape but android application of ionic 2 is not rotate
config.xml
<preference name='orientation' value='portrait'/>
app.component.js
import { ScreenOrientation } from '@ionic-native/screen-orientation';
initializeApp() {
this.platform.ready().then(() => {
if (this.platform.isPortrait) { this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE); } else { this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT); }
this.statusBar.styleDefault();
this.initPushNotification();
});
}