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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *