简体   繁体   中英

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

Home Page | ionic form | ionic issue I 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.

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

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">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM