I have a number of Angular components all with routing setup so that there is a specific url for each one. The requirement is that I need to navigate from one to the next in a series based on what data the user enters along the way. Some of these components will be used multiple times at different stages along the way.
I could add the logic in each component to work out which is the next component to go to, but I feel like this logic should be extracted out into a separate class somewhere which can view all the data collected so far, but I can't work out the right way to do this.
Any suggestions? Are there examples of this type of pattern anywhere?