LwrConfigRouteDefinition
To configure a router module with the Router Module Provider, you have to set up both LwrRouterConfig and LwrConfigRouteDefinition.
LwrConfigRouteDefinition object contains similar properties as the RouteDefinition object. handler and component are string references, as LwrConfigRouteDefinition is pure JSON and can't contain any functions. Only define either the handler or component property, not both.
| Property | Type | Required/Optional | Description | 
|---|---|---|---|
| id | String | Optional | Each LwrConfigRouteDefinitionmust have a uniqueididentifier. | 
| uri | String | Optional | A pattern for URI locations that match the LwrConfigRouteDefinition. You can't use the#and*characters. | 
| page | Required | The form of page references that match the LwrConfigRouteDefinition.pagevalues can be:parameterbindings, which map a path or query parameter from the URI to anattributesorstateproperty, or literal bindings, which hard code atype,attribute, orstateproperty to a literal value. Literal bindings can't contain the following characters:?,*,#,&,+,;,(,). | |
| patterns | Optional | A regular expression that a parameter has to match to be valid. To prevent unexpected values in the expression pattern, explicitly wrap the expression in the start-of-line character ( ^) and end-of-line character ($). For example:{"patterns": {"parameter": "^id[0-9a-zA-Z]{5}$"}}. | |
| exact | Boolean | Optional | If there's a nested router, this value must be false. The default value istrue. | 
| metadata | Optional | Developer-defined metadata in the form of key (string) and value (any type) pairs. You can use the metadataproperty to attach additional information to anLwrConfigRouteDefinition. ExtendLwrConfigRouteDefinitionfor required or more strongly typed metadata. | |
| handler | String | See description | An LwrConfigRouteDefinitionmust contain a handler or a component, but not both.handleris a string reference to theRouteHandlerclass specifier. | 
| component | String | See description | An LwrConfigRouteDefinitionmust contain a handler or a component, but not both.componentis a string reference to the view component specifier. Use this property to directly specify the view component without authoring a route handler. | 
See Also