fix(speaker-detail-module/navigation): Fixed the back navigation in the header of speakers page #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #60
Changes:
Manual testing guide:
app/tabs/schedule
/app/tabs/schedule/session/26
/app/tabs/schedule/speakers/speaker-details/98
/app/tabs/schedule/session/26
. (before it would be/app/tabs/speakers
)/app/tabs/speakers
now./app/tabs/speakers/session/75
./app/tabs/schedule/speakers/speaker-details/10
./app/tabs/speakers/session/75
. Before it would be/app/tabs/schedule/speakers/
.Context
At first I thought this is the only one solution, meanwhile later on I checked more in Angular + Ionic documentation.
It seems that issue happens because Angular requires nesting routes in order to preserve the history of navigation stack, otherwise it redirects to a root route that doesn't match a prefix of the current component hence causes reset of a navigation stack history.
The second option to solve it is by creating a separate route nested inside the
schedule
prefix. (similar to what is done with sessions inpycon-us-mobile/src/app/pages/tabs-page/tabs-page-routing.module.ts
Line 43 in ea706d6
Meanwhile imo it is a bad practice leading towards more bugs, because then it introduces circular dependencies between different url prefixes.
Probably there is a more elegant way we could do it 🙂
You can find a diff for main for the second option below ⬇️