Skip to content

Instantly share code, notes, and snippets.

@Verthon
Created April 7, 2020 09:21
Show Gist options
  • Save Verthon/537fe2fb407997aa7e45fa7cb49467bb to your computer and use it in GitHub Desktop.
Save Verthon/537fe2fb407997aa7e45fa7cb49467bb to your computer and use it in GitHub Desktop.
Function to navigate to the activity page wit EditMode
goToActivity(action, data, report, preview) {
let pageUrl = action.toLowerCase();
const routeParams = {
date: moment().format(),
href: this.getCurrentUrlWithoutTabs(this.router.url),
report: data,
editMode: true,
reportData: report,
previewMode: preview
}
this.appService.routeParams = routeParams;
let navigationExtras: NavigationExtras = {
state: {
date: this.reportDate,
href: this.getCurrentUrlWithoutTabs(this.router.url),
report: data,
editMode: true,
reportData: report,
previewMode: preview
},
};
let backHref = 'daily-overview'
this.router.navigateByUrl(`/tabs/activities/${pageUrl}`, navigationExtras)
.then(() => this.router.navigate([`/tabs/activities/${pageUrl}`]))
//this.router.navigate([`/tabs/activities/${pageUrl}`], navigationExtras);
//this.router.navigate([`/tabs/activities/${pageUrl}`, routeParams]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment