Platform resize event doesn't fire


#1

Hello

In ionic v4 i need to use the platform’s resize event.

After the platform ready event i have subscribed the resize event.When the device orientation changed/screen size resized i want the event to fire.

  import { Platform } from '@ionic/angular';
  constructor(public platform:Platform){
    this.InitiatePlatformIfReady();
  }

  InitiatePlatformIfReady() {
    this.platform.ready().then(() => {
      console.log('before subscribe');
      this.platform.resize.subscribe(() => {
        console.log('resized');
      });
    });
  }

The above code works fine in v3 but it doesn’t work as expected in v4.

Somebody please tell me how can i subscribe platform resize event ionic v4.


#2

I also stumbled upon this issue. Looks like there was a typo in v4. Created a PR: https://github.com/ionic-team/ionic/pull/15628


#3

Thank you for creating the PR