-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Angular Cookbook
By :

Not all routes in your Angular app should be accessible by everyone in the world. In this recipe, we'll learn how to create route guards in Angular to prevent unauthorized access to routes.
The project for this recipe resides in chapter07/start_here/using-route-guards
:
npm install
to install the dependencies of the project. ng serve -o
. This should open the app in a new browser tab, and you should see the app as follows:
Figure 7.5 – using-route-guards app running on http://localhost:4200
Now that we have the app running locally, let's see the steps of the recipe in the next section.
We have an app with a couple of routes already set up. You can log in as either an employee or an admin to get to the bucket list of the app. However, if you tap any...