Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Screen orientation not detected in ionic 4

$
0
0

@jai-g wrote:

Used the below implementation for screen rotation plugin:
import { ScreenOrientation } from ‘@ionic-native/screen-orientation/ngx’;
Below
this.screenOrientation.onChange().subscribe(
() => {
console.log(‘Orientation Changed’);
}
);

Error:
ERROR TypeError: Invalid event target
at setupSubscription (fromEvent.js:50)
at Observable._subscribe (fromEvent.js:24)
at Observable.push…/node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe (Observable.js:43)
at Observable.push…/node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe (Observable.js:29)
at ProjectListPage.push…/src/app/page-routing/project-list/project-list.page.ts.ProjectListPage.ngAfterViewInit (project-list.page.ts:60)
at callProviderLifecycles (core.js:22416)
at callElementProvidersLifecycles (core.js:22390)
at callLifecycleHooksChildrenFirst (core.js:22380)
at checkAndUpdateView (core.js:23316)
at callWithDebugContext (core.js:24177)

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>