PathLocationStrategy class
PathLocationStrategy
is a LocationStrategy used to configure the
Location service to represent its state in the
path of the
browser's URL.
PathLocationStrategy
is the default binding for LocationStrategy
provided in routerProviders.
If you're using PathLocationStrategy
, you must provide a provider for
appBaseHref to a string representing the URL prefix that should
be preserved when generating and recognizing URLs.
For instance, if you provide an appBaseHref
of '/my/app'
and call
location.go('/foo')
, the browser's URL will become
example.com/my/app/foo
.
- Inheritance
-
- Object
- LocationStrategy
- PathLocationStrategy
- Annotations
-
- @Injectable()
Constructors
- PathLocationStrategy(PlatformLocation _platformLocation, [@Optional() @Inject(appBaseHref) String? href])
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
back(
) → void -
override
-
forward(
) → void -
override
-
getBaseHref(
) → String -
override
-
hash(
) → String -
Creates a combined hash code for a number of objects.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onPopState(
EventListener fn) → void -
override
-
path(
) → String -
override
-
prepareExternalUrl(
String internal) → String -
override
-
pushState(
Object? state, String title, String url, String queryParams) → void -
override
-
replaceState(
Object? state, String title, String url, String queryParams) → void -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited