export APP_BASE_HREF : OpaqueToken
export APP_BASE_HREF : OpaqueToken
exported from angular2/router defined in angular2/src/router/location_strategy.ts (line 61)
The APP_BASE_HREF
token represents the base href to be used with the
PathLocationStrategy
.
If you're using PathLocationStrategy
, you must provide a provider to a string
representing the URL prefix that should be preserved when generating and recognizing
URLs.
Example
import {Component} from 'angular2/core';
import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
@Component({directives: [ROUTER_DIRECTIVES]})
@RouteConfig([
{...},
])
class AppCmp {
// ...
}
bootstrap(AppCmp, [
ROUTER_PROVIDERS,
PathLocationStrategy,
provide(APP_BASE_HREF, {useValue: '/my/app'})
]);