Angular SPA Framework - Router

An object responsible for routing.

import Router from "devextreme/framework/router"
Type:

Object

The DevExtreme SPA framework comes with an integrated navigation system that allows you to navigate to views easily - by specifying the view name along with the associated parameters. To encode navigation information to a URI and then decode it from the URL fragments, routing rules must be defined in the application. The Router object allows you to register routing rules to be used for navigation. Use the Router's register() method to add a routing rule.

To parse a URI or format an object to a URI, use the Router's parse(uri) and format(obj) methods respectively.

To learn more about routing rules, refer to the Declare a Routing topic.

Methods

This section describes the methods used to manipulate the application's navigation routing.

Name Description
format(obj)

Formats an object to a URI.

parse(uri)

Decodes the specified URI to an object using the registered routing rules.

register(pattern, defaults, constraints)

Adds a routing rule to the list of registered rules.