Sometimes, when you have your users in the middle of a workflow or form completion, you want to be helpful and offer a warning if they try to navigate away from what they’re in the middle of. Using Angular you accomplish this with the concept of Route Guards, specifically the CanDeactivate guard. The tutorial in the Angular documentation is good, but I feel that it leaves out some useful specifics that I will try to cover in this post.
The route guard foundation
The first step is to set up a guard service. This follows closely the first step in the Angular docs, the only differences being a different name for the interface (makes more sense to me), and a slightly different implementation of the same. This way of writing an interface is more in line with the