Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing beyond forward and backward #73

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Cybertron01Z
Copy link
Collaborator

# Conclusion

Implementing this new navigation concept showed me how working with the available tools and APIs can significantly simplify the implementation.
I was able to reduce a lot of code, make the implementation easier, and even resolve some edge case bugs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor point: most of the article uses 'we', and this use of 'I' feels odd.


## 2. Reading Current State

I mentioned before that navigating back or forward (`popstate`) would restore the state from the newly activated page.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the article uses 'we', and this section starts with 'I'. Suggest 'As mentioned before ' , to keep it neutral?

---

The navigation in complex web applications quickly goes beyond forward and back navigation.
I recently rebuilt the navigation for a large project.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vs We ? Most of the article is 'we'

@PASimmons
Copy link
Contributor

Nice topic, narrow-focused and well written! I don't know Angular, and I wonder if there's a way to package this functionality so that other projects can more easily adopt the same navigational flow with minimal integration?

implement small comments
The `Angular Router` provides an observable for navigation events.
We can subscribe to `router.events` and listen for `NavigationEnd`.
At this point, we know the navigation has successfully finished, and we can update the state.
One important note is that we do not want to increase the offset if we navigate using `{ replaceUrl: true }`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea: Explain why is replaceUrl used, what does it do, what are the implications.


Detecting back navigation into a finished flow can be solved using a guard: `flow-page-activation.guard`.
The guard verifies if the origin URL belongs to the current flow.
If it does, the navigation is allowed; otherwise, the navigation is blocked.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means that the "flow confirmation page" aka the page where the flow is finished, must not have the flowBasePath. Do I understand this correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants