This class should not be used directly by an application developer. Instead, use Location.

PlatformLocation encapsulates all calls to DOM apis, which allows the Router to be platform agnostic. This means that we can have different implementation of PlatformLocation for the different platforms that angular supports. For example, the default PlatformLocation is {@link BrowserPlatformLocation}, however when you run your app in a WebWorker you use WebWorkerPlatformLocation.

The PlatformLocation class is used directly by all implementations of LocationStrategy when they need to interact with the DOM apis like pushState, popState, etc...

LocationStrategy in turn is used by the Location service which is used directly by the Router in order to navigate between routes. Since all interactions between {@link Router} / Location / LocationStrategy and DOM apis flow through the PlatformLocation class they are all platform independent.

Constructors

PlatformLocation()

Properties

hash → String

read-only
hashCode → int

Get a hash code for this object.

read-only, inherited
pathname → String

read-only
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

read-only

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

back() → void

forward() → void

getBaseHrefFromDOM() → String

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
onHashChange(EventListener fn) → void

onPopState(EventListener fn) → void

pushState(state, String title, String url) → void

replaceState(state, String title, String url) → void

toString() → String

Returns a string representation of this object.

inherited