fix(docs): Updated docs for default router location strategy

Closes #4517
This commit is contained in:
Brandon Roberts 2015-10-04 20:11:31 -05:00 committed by Brian Ford
parent 35a61b449a
commit 075011f2fe
2 changed files with 6 additions and 9 deletions

View File

@ -9,9 +9,6 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
* [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)
* of the browser's URL. * of the browser's URL.
* *
* `HashLocationStrategy` is the default binding for {@link LocationStrategy}
* provided in {@link routerBindings} and {@link ROUTER_BINDINGS}.
*
* For instance, if you call `location.go('/foo')`, the browser's URL will become * For instance, if you call `location.go('/foo')`, the browser's URL will become
* `example.com#/foo`. * `example.com#/foo`.
* *
@ -38,7 +35,7 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
* } * }
* *
* bootstrap(AppCmp, [ * bootstrap(AppCmp, [
* routerBindings(AppCmp) // includes binding to HashLocationStrategy * routerBindings(AppCmp)
* ]); * ]);
* ``` * ```
*/ */

View File

@ -9,6 +9,9 @@ import {LocationStrategy} from './location_strategy';
* [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
* browser's URL. * browser's URL.
* *
* `PathLocationStrategy` is the default binding for {@link LocationStrategy}
* provided in {@link routerBindings} and {@link ROUTER_BINDINGS}.
*
* If you're using `PathLocationStrategy`, you must provide a binding for * If you're using `PathLocationStrategy`, you must provide a binding for
* {@link APP_BASE_HREF} to a string representing the URL prefix that should * {@link APP_BASE_HREF} to a string representing the URL prefix that should
* be preserved when generating and recognizing URLs. * be preserved when generating and recognizing URLs.
@ -26,9 +29,7 @@ import {LocationStrategy} from './location_strategy';
* ROUTER_DIRECTIVES, * ROUTER_DIRECTIVES,
* routerBindings, * routerBindings,
* RouteConfig, * RouteConfig,
* Location, * Location
* LocationStrategy,
* PathLocationStrategy
* } from 'angular2/router'; * } from 'angular2/router';
* *
* @Component({...}) * @Component({...})
@ -43,8 +44,7 @@ import {LocationStrategy} from './location_strategy';
* } * }
* *
* bootstrap(AppCmp, [ * bootstrap(AppCmp, [
* routerBindings(AppCmp), * routerBindings(AppCmp), // includes binding to PathLocationStrategy
* bind(LocationStrategy).toClass(PathLocationStrategy),
* bind(APP_BASE_HREF).toValue('/my/app') * bind(APP_BASE_HREF).toValue('/my/app')
* ]); * ]);
* ``` * ```