Outline

In this video...

You will learn about how to navigate to a route from within the code.

Sometimes we need to navigate to a route from within code. Some of the reasons we may need to do this are:

  1. Handling situations where the anchor tag won't work
  2. Routing based on logic in the code. For example, navigating to login first if the user hasn't logged in.

In these cases we need to be able to navigate within our code. This is possible by using the Router service from the RouterModule.

 

I finished! On to the next chapter