Open dsebastien opened 5 years ago
Good idea @dsebastien!
In fact I think this should be really easy to implement since we already implemented the navigateToPrevious()
method which does basically that and keeping the state of each transition. 😉
We just need to adapt the Breadcrumb component to "enable" such functionality and expose the navigation history of the StarkRoutingService so the Breadcrumb component can use it.
One remark though, I don't think it is necessary to provide a service to let developers manipulate the contents of the stack cause it may be too much overkill. I suggest to provide an output that will emit whenever the Breadcrumb component re-generates the breadcrumbs so the developer can react on it and adapt the breadcrumbs if needed.
@carlo-nomes @SuperITMan What do you think?
I'm submitting a...
Current behavior
Currently, the breadcrumb component shows a hierarchical view based on the route tree.
Expected behavior
It would be nice for user experience if it supported a history based mode.
In that mode , the breadcrumb would get a new entry each time the user navigates. So it would show links to easily go back to a previous screen where the user was.
I'll post an example to clarify the idea.
Scenario 1:
Of course the length must be limited, but this breadcrumb mode is very useful for scenarios where users go from seach/master to detail, then into other entities/concepts/pages, the moves somewhere else, but wants to keep a trail and be able to go back to where he was before (ideally with the same state, but that's another problem).
Ideally, a service could also be provided to let developers manipulate the contents of the "stack" used by the breadcrumbs.
Environment