In an e-commerce application, certain routes should only be accessible after a user logs in. To check the user's authentication status before allowing them to access these routes, which Route Guard would you use?
- CanActivate
- CanActivateChild
- CanLoad
- Resolve
The CanActivate route guard is used to protect routes based on whether a user is authenticated or not. It's commonly used to restrict access to routes that require user authentication.
Loading...
Related Quiz
- You notice that styles defined in a component are affecting other components throughout the application. Which view encapsulation mode might the component be using?
- What does 'View Encapsulation' in Angular control?
- Custom attribute directives can alter the appearance or behavior of an element without changing its ________.
- To achieve lazy loading in Angular, the loadChildren property uses the ________ syntax.
- A client asks for a feature where certain parts of the application should only be accessible to authenticated users. Which feature of Angular would you use to implement this?