Question · Angular course · Module 4: Routing

CanDeactivate

What is the CanDeactivate guard used for?

Answer options

  • It checks whether the user is logged in
  • It asks the user whether they want to leave the page (e.g. unsaved changes)
  • It blocks loading of lazy modules
  • It fetches data before navigation

You can check the correct answer by solving this task in the CodeWorlds game.