diff --git a/modules/@angular/common/src/location/path_location_strategy.ts b/modules/@angular/common/src/location/path_location_strategy.ts index 2670d54f05..2e28253f18 100644 --- a/modules/@angular/common/src/location/path_location_strategy.ts +++ b/modules/@angular/common/src/location/path_location_strategy.ts @@ -25,44 +25,17 @@ import {PlatformLocation, UrlChangeListener} from './platform_location'; * `PathLocationStrategy` is the default binding for {@link LocationStrategy} * provided in {@link ROUTER_PROVIDERS}. * - * If you're using `PathLocationStrategy`, you must provide a provider for - * {@link APP_BASE_HREF} to a string representing the URL prefix that should - * be preserved when generating and recognizing URLs. + * If you're using `PathLocationStrategy`, you must provide a {@link APP_BASE_HREF} + * or add a base element to the document. This URL prefix that will 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 - * - * ``` - * import {Component} from '@angular/core'; - * import {bootstrap} from '@angular/platform-browser/browser'; - * import { - * Location, - * APP_BASE_HREF - * } from '@angular/common'; - * import { - * ROUTER_DIRECTIVES, - * ROUTER_PROVIDERS, - * RouteConfig - * } from '@angular/router'; - * - * @Component({directives: [ROUTER_DIRECTIVES]}) - * @RouteConfig([ - * {...}, - * ]) - * class AppCmp { - * constructor(location: Location) { - * location.go('/foo'); - * } - * } - * - * bootstrap(AppCmp, [ - * ROUTER_PROVIDERS, // includes binding to PathLocationStrategy - * {provide: APP_BASE_HREF, useValue: '/my/app'} - * ]); - * ``` + * Similarly, if you add `` to the document and call + * `location.go('/foo')`, the browser's URL will become + * `example.com/my/app/foo`. * * @stable */