Home > OS >  Lag during redirection from home page to a form in ionic angular app
Lag during redirection from home page to a form in ionic angular app

Time:01-16

Home Page|ionic form|ionic issueI have newly created an ionic angular app. I have created a form. I have a button in home page on click of it redirects to the form. But the issue is that there is a lag when the form is loaded.

There is no smooth transition from home page to the form. Could someone help on how to resolve this issue and achieve a smooth transition from the home page to the form.

CodePudding user response:

You can wait for the transition to be over before updating the form view with the ionViewDidEnter lifecycle method. Don't delay the data loading tho, only template update or heavy JS computations would cause lag.

Without extra rendering the animation will be smooth. You can display placeholders in the meanwhile.

https://ionicframework.com/docs/angular/lifecycle

CodePudding user response:

Basically this is not an issue as I had thought earlier but it is a default behavior of ionic routing. Looks like this is the default animation ionic provides when we route to some page. By setting [animated]="false" we can override the default behavior. Like this:

<ion-router-outlet id="main-content" [animated]="false">

  • Related