10. Create a generic canDeactivate Guard in Angular

Опубликовано: 28 Июль 2026
на канале: Code Shots With Profanis
3,397
61

In this video, we will see how to protect a user from leaving a page that has unsaved changes. We will warn the user of the unsaved changes if tries to change the page without first submitting the #form.

We will use #angular reactive forms for the example and we will make use of the #routing feature which is the Deactivate Guard

#angular #form #reactiveform #tutorial #routing