Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Router keeping multiple copies of page

$
0
0

We have a desktop app (Ionic 5/Angular) and some lazy loaded pages.
As user navigates around, it seems the ion-router-outlet accumulates multiple copies of the pages as children, with the inactive copies having the class “ion-page-hidden”;
These hidden pages have caused us some difficulties, e.g. Cypress finding the same target element across multiple of these pages. Is there a way to tell the router not to keep these hidden pages around?

FWIW the page’s Route definition looks like:

  {
    path: 'course/:id',
    component: CoursePage,
    canActivate: [ CheckLoggedInGuard ],
    loadChildren: './pages/course/course.module#CoursePageModule'
  },

Thanks!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



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