Skip to content

Commit 075011f

Browse files
brandonrobertsbtford
authored andcommitted
fix(docs): Updated docs for default router location strategy
Closes angular#4517
1 parent 35a61b4 commit 075011f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

modules/angular2/src/router/hash_location_strategy.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
99
* [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)
1010
* of the browser's URL.
1111
*
12-
* `HashLocationStrategy` is the default binding for {@link LocationStrategy}
13-
* provided in {@link routerBindings} and {@link ROUTER_BINDINGS}.
14-
*
1512
* For instance, if you call `location.go('/foo')`, the browser's URL will become
1613
* `example.com#/foo`.
1714
*
@@ -38,7 +35,7 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
3835
* }
3936
*
4037
* bootstrap(AppCmp, [
41-
* routerBindings(AppCmp) // includes binding to HashLocationStrategy
38+
* routerBindings(AppCmp)
4239
* ]);
4340
* ```
4441
*/

modules/angular2/src/router/path_location_strategy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import {LocationStrategy} from './location_strategy';
99
* [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
1010
* browser's URL.
1111
*
12+
* `PathLocationStrategy` is the default binding for {@link LocationStrategy}
13+
* provided in {@link routerBindings} and {@link ROUTER_BINDINGS}.
14+
*
1215
* If you're using `PathLocationStrategy`, you must provide a binding for
1316
* {@link APP_BASE_HREF} to a string representing the URL prefix that should
1417
* be preserved when generating and recognizing URLs.
@@ -26,9 +29,7 @@ import {LocationStrategy} from './location_strategy';
2629
* ROUTER_DIRECTIVES,
2730
* routerBindings,
2831
* RouteConfig,
29-
* Location,
30-
* LocationStrategy,
31-
* PathLocationStrategy
32+
* Location
3233
* } from 'angular2/router';
3334
*
3435
* @Component({...})
@@ -43,8 +44,7 @@ import {LocationStrategy} from './location_strategy';
4344
* }
4445
*
4546
* bootstrap(AppCmp, [
46-
* routerBindings(AppCmp),
47-
* bind(LocationStrategy).toClass(PathLocationStrategy),
47+
* routerBindings(AppCmp), // includes binding to PathLocationStrategy
4848
* bind(APP_BASE_HREF).toValue('/my/app')
4949
* ]);
5050
* ```

0 commit comments

Comments
 (0)