can.route.binding
- typedef
{Object}
Object
Properties
-
root
{String}
The starting point of the url to match. For
hashchange
, the value is "#!". Forpushstate
, the value is/
. This can be overwritten before can.route.ready is called like:can.route.bindings.pushstate.root = "/site/"
-
querySeparator
{String}
Specifies the seperator between the path part of the url and the query (also known as search) part of the url. For
hashchange
, the value is"&"
. Forpushstate
, the value is"?"
. -
paramsMatcher
{RegExp}
A regular expression that is used to identify the
key=value
pairs in the query part of the url. -
matchingPartOfURL
{function()}
Reads the url and returns the part that is used for matching routes.
-
setURL
{function(path)}
Called with the serialized can.route data after a route has changed. Returns what the url has been updated to.
-
{path}
-
-
bind
{function()}
Attaches listeners to the document to know when the url has changed. Typically
bind
is called when can.route.ready is called. -
unbind
{function()}
Tears down the bindings to the document.