Your application has a module that is loaded lazily, and you want to ensure that this module is only loaded for administrators. How would you implement this restriction?
- CanActivateChild
- CanDeactivate
- CanLoad
- Resolve
To ensure that a module is only loaded for specific users (e.g., administrators), you would use the CanLoad route guard. This guard is applied at the route level and checks whether the user is authorized to load a lazy-loaded module.
Loading...
Related Quiz
- How can you create a directive that listens for host events and reacts accordingly?
- When content is projected into a child component, the data binding context remains that of the ________ component.
- Which is NOT a lifecycle hook in Angular?
- For a router link to get an "active" CSS class when the link's route is active, you can use the ________ directive.
- What's the benefit of using immutable data structures in Angular applications?