How can you ensure that a user is redirected to a login page when attempting to access a protected child route without proper authentication?
- Use 'canActivate' Route Guard and return 'false' on unauthorized
- Use 'canActivateChild' Route Guard and return 'false' on unauthorized
- Use 'canDeactivate' Route Guard and return 'false' on unauthorized
- Use 'canLoad' Route Guard and return 'false' on unauthorized
To ensure users are redirected to a login page when accessing a protected child route without proper authentication, you use 'canActivate' and return 'false.'
Loading...
Related Quiz
- In Angular, the _____ pipe is used to automatically subscribe and unsubscribe from an Observable.
- In a NgRx setup, the _______ function is used to create a new state object by copying the existing state and making changes to it.
- In Angular testing, what is the purpose of the async and fakeAsync utilities?
- Which testing framework is commonly used for writing unit tests in Angular applications?
- How can you preload data for a route before navigating to it?