An observable surfacing the active routing instruction that is currently being processed or has recently finished processing.
The instruction object has config
, fragment
, queryString
, params
and queryParams
properties.
The active item/screen based on the current navigation state.
Inspects routes and modules before activation. Can be used to protect access by cancelling navigation or redirecting.
The route handlers that are registered. Each handler consists of a routePattern
and a callback
.
Indicates that the router (or a child router) is currently in the process of navigating.
The route configurations that have been designated as displayable in a nav ui (nav:true).
The route configs that are registered.
Builds an observable array designed to bind a navigation UI to. The model will exist in the navigationModel
property.
The default order to use for navigation visible routes that don't specify an order. The defualt is 100.
T in DurandalRouterBase<T>
Converts a route to a hash suitable for binding to a link's href.
string
The hash.
Converts a route to a module id. This is only called if no module id is supplied as part of the route mapping.
string
The module id.
Converts a route to a displayable title. This is only called if no title is specified as part of the route mapping.
string
The title.
Creates a child router.
T in DurandalRouterBase<T>
The child router.
Attempt to load the specified URL fragment. If a route succeeds with a match, returns true
. If no defined routes matches the fragment, returns false
.
The URL fragment to find a match for.
boolean
True if a match was found, false otherwise.
Makes all configured routes and/or module ids relative to a certain base url.
The value is used as the base for routes and module ids.
T in DurandalRouterBase<T>
Makes all configured routes and/or module ids relative to a certain base url.
If an object, you can specify route
and moduleId
separately. In place of specifying route, you can set fromParent:true
to make routes automatically relative to the parent router's active route.
T in DurandalRouterBase<T>
Maps route patterns to modules.
A route.
T in DurandalRouterBase<T>
Maps route patterns to modules.
A route pattern.
The module id to map the route to.
T in DurandalRouterBase<T>
Maps route patterns to modules.
A route pattern.
The module id to map the route to.
T in DurandalRouterBase<T>
Maps route patterns to modules.
A route pattern.
The route's configuration.
T in DurandalRouterBase<T>
Maps route patterns to modules.
A route pattern.
The route's configuration.
T in DurandalRouterBase<T>
Maps route patterns to modules.
The route's configuration.
T in DurandalRouterBase<T>
Maps route patterns to modules.
An array of route configurations.
T in DurandalRouterBase<T>
Configures the router to map unknown routes to modules at the same path.
T in DurandalRouterBase<T>
Configures the router use the specified module id for all unknown routes.
Represents the module id to route all unknown routes to.
T in DurandalRouterBase<T>
Configures how the router will handle unknown routes.
Called back with the route instruction containing the route info. The function can then modify the instruction by adding a moduleId and the router will take over from there.
T in DurandalRouterBase<T>
Configures how the router will handle unknown routes.
The route configuration to use for unknown routes.
T in DurandalRouterBase<T>
Save a fragment into the hash history, or replace the URL state if the
'replace' option is passed. You are responsible for properly URL-encoding
the fragment in advance.
The options object can contain trigger: false
if you wish to not have the
route callback be fired, or replace: true
, if
you wish to modify the current URL without adding an entry to the history.
The url fragment to navigate to.
boolean
Returns true/false from loading the url.
Save a fragment into the hash history, or replace the URL state if the
'replace' option is passed. You are responsible for properly URL-encoding
the fragment in advance.
The options object can contain trigger: false
if you wish to not have the
route callback be fired, or replace: true
, if
you wish to modify the current URL without adding an entry to the history.
The url fragment to navigate to.
An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is true
by default.
boolean
Returns true/false from loading the url.
Navigates back in the browser history.
Removes the callbacks for the specified events.
T in DurandalEventSupport<T>
Creates a subscription or registers a callback for the specified event.
One or more events, separated by white space.
A subscription is returned.
Creates a subscription or registers a callback for the specified event.
One or more events, separated by white space.
T in DurandalEventSupport<T>
The events object is returned for chaining.
Parses a query string into an object.
The query string to parse.
Object
An object keyed according to the query string parameters.
Creates a function that will trigger the specified events when called. Simplifies proxying jQuery (or other) events through to the events object.
One or more events, separated by white space to trigger by invoking the returned function.
Function
Calling the function will invoke the previously specified events on the events object.
Resets the router by removing handlers, routes, event handlers and previously configured options.
T in DurandalRouterBase<T>
Add a route to be tested when the url fragment changes.
The route pattern to test against.
The callback to execute when the route pattern is matched.
Triggers the specified events.
T in DurandalEventSupport<T>
Updates the document title based on the activated module instance, the routing instruction and the app.title.
The activated module.
The routing instruction associated with the action. It has a config
property that references the original route mapping config.