LocationStrategy class

LocationStrategy is responsible for representing and reading route state from the browser's URL. Angular provides two strategies: HashLocationStrategy and PathLocationStrategy (default).

This is used under the hood of the Location service.

Applications should use the Router or Location services to interact with application route state.

For instance, HashLocationStrategy produces URLs like http://example.com#/foo, and PathLocationStrategy produces http://example.com/foo as an equivalent URL.

See these two classes for more.

Implementers

Constructors

LocationStrategy()

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

back() → void
forward() → void
getBaseHref() → String
hash() → String
onPopState(EventListener fn) → void
path() → String
prepareExternalUrl(String internal) → String
pushState(dynamic state, String title, String url, String queryParams) → void
replaceState(dynamic state, String title, String url, String queryParams) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited