Router

class Router(module, submods, routes)

Almighty class controlling the routing internals. It is automatically instantiated by the main application Module

Attributes:

  • autorouter (True):

    If True and the application components have not issued a router-outlet, the router instance will do it.

  • selector ('router-outlet'):

    If autorouter is True and the components define no router-outlet for the output of a route, the selector will be issued automatically

  • route

    Contains the RouteSnapshot corresponding to the active route

  • routes

    A list of the defined Routes (children routes are reachable inside the Route)

  • basehref

    The automatically calculated base href for the app

route_to(pathname, *args, **kwargs)

As the name indicates, this method routes to: pathname

  • pathname

    Absolute or relative path. . and .. are supported as path elements

  • args and kwargs will be passed as arguments to the route

back()

Navigate once backwards

forward()

Navigate once forward

navigate_to(pathname, **kwargs)

This method navigates away from the app to the given pathname

  • pathname

    URI or Absolute or relative path.

  • kwargs will be passed as query arguments the route