Constructor
new KnockoutRouterAdapter(router)
Constructor
Parameters:
| Name | Type | Description |
|---|---|---|
router |
CoreRouter | The CoreRouter instance on which this adapter will listen for state changes. |
Fields
-
(readonly) path :ko.Observable.<string>
-
An observable containing the current value of CoreRouterState.path. This observable can be used in two-way bindings to read the value of the current state, as well as navigate the router to a new path. When this observable's value changes, the underlying CoreRouter.go method is called with the new value as the path.
-
(readonly) state :ko.Observable.<CoreRouter.CoreRouterState>
-
An observable containing the current CoreRouterState from the router, if defined. Note that this CoreRouterState's
pathis the original string value from the class, and can only be used read-only. In order to navigate the router from a component value using two-way binding, use the observable path instead. This observable is read-only, and may not be written to.