Routes and router outlets

Explanation on the concept of routers and router outlets with the Packhunt Workbench

Routers and RouterOutlets define the hierarchical structure of frames in the solution. A web page is created by defining one or more frames. Frames are generic containers of content that can be nested inside one another. The router automatically maps links to web pages, each consisting of different combinations of nested frames.

A router link consists of a series of paths separated by forward slashes. For example, consider two links: /main/first and /main/second. Both links will show a page containing two frames:

  • The /main/first router link will show the main frame with the first frame nested inside it.
  • The /main/second router link will show the main frame with the second frame nested inside it.

The nesting of frames inside other frames is achieved using outlets. The main frame defines an outlet that contains either the first frame or the second frame.

Below, several examples of different ways of using routing are given: