Angular: Protecting Routes using Route Guards

Now that you have developed your application using Angular 2.x. The next important step would be to limit access to certain routes. In other words, whenever user tries to navigates to a route, your application needs to decide whether or not to allow navigation.
This is where “Angular Route Guards” come into picture.
Angular exposes few interfaces which can help with this decision.

This medium post by Ryan Chenkie explains in detail about the 5 different types of guards offered by Angular:

These interfaces return a boolean indicating whether or not navigation to a route should be allowed.


Leave a Reply

Your email address will not be published. Required fields are marked *