Now that we have the base code set up, let's list the steps for us to build an app that will enable us to create a custom Back button in a browser:
- Creating states for the application.
- Recording when the state of the application changes.
- Detecting a click on our custom Back button.
- Updating the list of the states that are being tracked.
Let's quickly add a few states to the application, which are also known as routes in Angular. All SPA frameworks have some form of routing module, which you can use to set up a few routes for your application.
Once we have the routes and the routing set up, we will end up with a directory structure, as follows:
Now let's ...