In this blog, we’ll give you a rundown of how we’ve implemented routing in our single page project management tool – PineStem.
Routing is a process of navigating the user to the desired location based on the action they perform.
Maintaining the user’s navigation history is a major challenge while developing a single page application(SPA).
To overcome this problem, we implemented a simple stack based solution which only involves pushing and popping an object with required properties.
You can find the sample code and a demonstration in the Plunker here – https://plnkr.co/OnBe1bc9Q7h1tYBK1pSY?p=info
For PineStem, we’ve used a popular routing plugin named AngularUI Router.
The idea behind our implementation is quite simple. We store the parameters that are required to navigate back to a particular state in an object and push it into an array.