Location
Simple wrapper for window.location and window.history.
Constructor Summary
| Public Constructor | ||
| public |
constructor(window: Object) Creates a new location wrapper instance. |
|
Method Summary
| Public Methods | ||
| public |
activate() Starts monitoring history popstate event. |
|
| public |
back() Navigates back in history. |
|
| public |
Stops monitoring history popstate event. |
|
| public |
Formats given properties into an url. |
|
| public |
Returns current url. |
|
| public |
Parses the given url. |
|
| public |
Adds an entry to history. |
|
| public |
Registers a callback to be executed when history changes. |
|
| public |
Replaces current history entry. |
|
| public |
Specifies current url. |
|
| public |
unregister(callback: Function): Boolean Removes the given callback from the registry. |
|
Public Constructors
Public Methods
public format(properties: Object): String source
Formats given properties into an url.
Params:
| Name | Type | Attribute | Description |
| properties | Object |
public parse(href: String): Object source
Parses the given url.
Params:
| Name | Type | Attribute | Description |
| href | String |
public push(href: String) source
Adds an entry to history.
Params:
| Name | Type | Attribute | Description |
| href | String |
public register(callback: Function, context: Object, trace: Error): Function source
Registers a callback to be executed when history changes.
public replace(href: String) source
Replaces current history entry.
Params:
| Name | Type | Attribute | Description |
| href | String |