Created
April 7, 2020 09:21
-
-
Save Verthon/537fe2fb407997aa7e45fa7cb49467bb to your computer and use it in GitHub Desktop.
Function to navigate to the activity page wit EditMode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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