export class PathLocationStrategy
export class PathLocationStrategy
exported from angular2/router defined in angular2/src/router/path_location_strategy.ts (line 11)
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 ROUTER_PROVIDERS
.
If you're using PathLocationStrategy
, you must provide a provider for
APP_BASE_HREF
to a string representing the URL prefix that should
be preserved when generating and recognizing URLs.
For instance, if you provide an APP_BASE_HREF
of '/my/app'
and call
location.go('/foo')
, the browser's URL will become
example.com/my/app/foo
.
Example
Annotations
@Injectable()
@Injectable()
Constructor
constructor(_platformLocation: PlatformLocation, href?: string)
constructor(_platformLocation: PlatformLocation, href?: string)
Not Yet Documented
Members
onPopState(fn: EventListener) : void
onPopState(fn: EventListener) : void
Not Yet Documented
getBaseHref() : string
getBaseHref() : string
Not Yet Documented
prepareExternalUrl(internal: string) : string
prepareExternalUrl(internal: string) : string
Not Yet Documented
path() : string
path() : string
Not Yet Documented
pushState(state: any, title: string, url: string, queryParams: string)
pushState(state: any, title: string, url: string, queryParams: string)
Not Yet Documented
replaceState(state: any, title: string, url: string, queryParams: string)
replaceState(state: any, title: string, url: string, queryParams: string)
Not Yet Documented
forward() : void
forward() : void
Not Yet Documented
back() : void
back() : void
Not Yet Documented