Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Ionic 4 Angular proper routing approach

$
0
0

@Verthon wrote:

Hello I have a problem with same routes /activities:name that for example /activities/supplies is used for POST or PUT method based on params provided isEditModeOn. However it works only when I’m navigating to the route for the first time.

When I navigate to the route multiple times it just output old outdated data from previous params.

Do I really need to create different pages like plain activities:name and activities:name-edit ?
Thank you for any suggestion :pray:

Function where I navigate to the page:

let navigationExtras: NavigationExtras = {
      state: {
        date: this.reportDate,
        href: this.getCurrentUrlWithoutTabs(this.router.url),
        report: data,
        editMode: true,
        reportData: report,
        previewMode: preview
      },
      replaceUrl: true,
      skipLocationChange: true
    };
    let backHref = 'daily-overview'
    this.router.navigateByUrl(`/tabs/activities/${pageUrl}`, navigationExtras)
    .then(() => this.router.navigate([`/tabs/activities/${pageUrl}`]))

App routing module

{
    path: 'activities/:name',
    loadChildren: () =>
      import('./pages/activities/activities-routing.module').then(m => m.ActivitiesRoutingModule)
  }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



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