Home Reference Source
public class | source

Url

This class is responsible for parsing and matching urls

Constructor Summary

Public Constructor
public

Creates an instance of Url

Member Summary

Public Members
public get

hash: String: *

Returns the hash of the url

public get

host: String: *

Returns the host and port of the url

public get

Returns the parameters of the url

public get

Returns all the parts of the url

public get

Returns the password from the url

public get

path: String: *

Returns the path of the url

public get

Returns the protocol of the url

public get

Returns the username from the url

Method Summary

Public Methods
public

set(url: String): Url

Set the url string

public

Return the url

Public Constructors

public constructor(url: String) source

Creates an instance of Url

Params:

NameTypeAttributeDescription
url String

A url string. If no url is provided window.location.href is used

Public Members

public get hash: String: * source

Returns the hash of the url

Return:

String

The hash of the url

public get host: String: * source

Returns the host and port of the url

Return:

String

The string containing the hostname and port

public get parameters: Object: * source

Returns the parameters of the url

Return:

Object

The query string parameters of the url

public get parts: Object: * source

Returns all the parts of the url

Return:

Object

The object containing all the url parts

public get password: String: * source

Returns the password from the url

Return:

String

The password from the url

public get path: String: * source

Returns the path of the url

Return:

String

The string containing the path

public get protocol: String: * source

Returns the protocol of the url

Return:

String

The string containing the protocol

public get username: String: * source

Returns the username from the url

Return:

String

The username from the url

Public Methods

public set(url: String): Url source

Set the url string

Params:

NameTypeAttributeDescription
url String

The url string

Return:

Url

The instance of the Url class

public toString(): String source

Return the url

Return:

String

The provided url