If you have an application where some modules are loaded on-demand, and you want to restrict this based on user roles, which Route Guard should you implement?
- CanActivate
- CanActivateChild
- CanDeactivate
- CanLoad
To restrict loading of modules based on user roles in a lazy-loaded scenario, you should implement the CanLoad guard. It allows you to check conditions before the module is loaded, ensuring that only authorized users can access certain parts of the application.
Loading...
Related Quiz
- You're building a layout component that should allow users to inject custom content for the header, sidebar, and main content area. What approach would you take to enable this functionality in the layout component?
- How can you achieve nested routing (child routes) within an Angular application?
- Which object is responsible for tracking the value and validation status of an individual form control in reactive forms?
- Which Angular feature allows you to load certain modules only when they are needed?
- For optimal performance and faster initial page loads, Angular recommends using ______ compilation.