Home Reference Source Test
public class | source

Location

Simple wrapper for window.location and window.history.

Constructor Summary

Public Constructor
public

constructor(window: Object)

Creates a new location wrapper instance.

Member Summary

Public Members
public
public

handler: *

public

window: *

Method Summary

Public Methods
public

Starts monitoring history popstate event.

public

back()

Navigates back in history.

public

Stops monitoring history popstate event.

public

format(properties: Object): String

Formats given properties into an url.

public

get(): String

Returns current url.

public

parse(href: String): Object

Parses the given url.

public

push(href: String)

Adds an entry to history.

public

register(callback: Function, context: Object, trace: Error): Function

Registers a callback to be executed when history changes.

public

replace(href: String)

Replaces current history entry.

public

set(href: String)

Specifies current url.

public

Removes the given callback from the registry.

Public Constructors

public constructor(window: Object) source

Creates a new location wrapper instance.

Params:

NameTypeAttributeDescription
window Object

Public Members

public callbacks: * source

public handler: * source

public window: * source

Public Methods

public activate() source

Starts monitoring history popstate event.

public back() source

Navigates back in history.

public deactivate() source

Stops monitoring history popstate event.

public format(properties: Object): String source

Formats given properties into an url.

Params:

NameTypeAttributeDescription
properties Object

Return:

String

url

public get(): String source

Returns current url.

Return:

String

url

public parse(href: String): Object source

Parses the given url.

Params:

NameTypeAttributeDescription
href String

Return:

Object

parsed

public push(href: String) source

Adds an entry to history.

Params:

NameTypeAttributeDescription
href String

public register(callback: Function, context: Object, trace: Error): Function source

Registers a callback to be executed when history changes.

Params:

NameTypeAttributeDescription
callback Function

callback to be registered

context Object

this variable for the callback

trace Error

error

Return:

Function

callback added callback

public replace(href: String) source

Replaces current history entry.

Params:

NameTypeAttributeDescription
href String

public set(href: String) source

Specifies current url.

Params:

NameTypeAttributeDescription
href String

public unregister(callback: Function): Boolean source

Removes the given callback from the registry.

Params:

NameTypeAttributeDescription
callback Function

to be removed

Return:

Boolean

unregistered true if the callback was found