You have a multi-step form in your Angular application. At any step, if the user tries to navigate away without saving, you want to alert them. Which Route Guard will best serve this purpose?
- CanActivate
- CanActivateChild
- CanDeactivate
- Resolve
The CanDeactivate route guard is used for scenarios where you want to prompt the user with a confirmation message before navigating away from a route. It's commonly used for guarding forms to prevent users from losing unsaved data.
Loading...
Related Quiz
- Which of the following is a push-based mechanism in JavaScript?
- How can you provide a custom Value Accessor for a form control in Angular?
- You have a requirement to build a complex multi-step form with the ability to navigate between steps and validate each step individually. What approach would you take in Angular to handle this?
- Your application has a dynamic form where fields can be added or removed based on user input. Which feature of Angular's Reactive Forms would you leverage to accomplish this?
- To update your Angular CLI globally to the latest version, you would use the command npm install -g ________.