You want to implement a feature that prompts the user if they try to navigate away from a form without saving changes. Which Route Guard would you use to achieve this?
- CanActivate Route Guard
- CanDeactivate Route Guard
- CanLoad Route Guard
- Resolve Route Guard
To prompt the user when navigating away from a form, you should use the CanDeactivate Route Guard. It checks if the form can be deactivated without saving changes.
Loading...
Related Quiz
- You are building a registration form and want to ensure that the password and confirm password fields match. Which approach would you use to validate this?
- To display a validation error message only when a form control is touched and invalid, you can use the expressions formControlName._____ and formControlName._____.
- What is the primary advantage of using the async pipe in Angular templates?
- How can you define a child route in an Angular application?
- What is the difference between a BehaviorSubject and a ReplaySubject?