Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic Live Reload - Takes long time and doesn't save page

I have an Ionic 4 project, and I'm using ionic serve to test the app. I have 2 issues/questions on this.

  1. It takes about 10 seconds to reload every time I want to check a change.
  2. It never saves the place in the navigation when it reloads. It always goes back to the root page.

I'm finding these 2 issues very frustrating and difficult to work with. Is there a better way to test and develop Ionic apps? Suggestions? Thanks.

like image 255
nachshon f Avatar asked Dec 02 '18 22:12

nachshon f


Video Answer


1 Answers

You can work around these problems, make sure you are using lazy loading to ensure a quicker reload.

When you are working at length deep in your app write some code to navigate there automatically on app load, then remove it/adjust it when you need to. I usually place something like this.router.navigate(["myPage"]); in the app.ts and change it as needed.

For style changes you can make adjustments in the browser dev window while inspecting elements with no reload time, then "finalise" them in your app when you finished tweaking. I do this by clicking inspect on the element I need to adjust.

like image 182
Shannon Avatar answered Sep 24 '22 05:09

Shannon