Skip to content

Commit c17c33c

Browse files
docs(router): Updated example for hash location strategy
Closes angular#5010
1 parent a87c5d9 commit c17c33c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/angular2/src/router/hash_location_strategy.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
1515
* ### Example
1616
*
1717
* ```
18-
* import {Component, View} from 'angular2/angular2';
18+
* import {Component, provide} from 'angular2/angular2';
1919
* import {
2020
* ROUTER_DIRECTIVES,
2121
* ROUTER_PROVIDERS,
2222
* RouteConfig,
23-
* Location
23+
* Location,
24+
* LocationStrategy,
25+
* HashLocationStrategy
2426
* } from 'angular2/router';
2527
*
2628
* @Component({directives: [ROUTER_DIRECTIVES]})
@@ -33,7 +35,10 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
3335
* }
3436
* }
3537
*
36-
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
38+
* bootstrap(AppCmp, [
39+
* ROUTER_PROVIDERS,
40+
* provide(LocationStrategy, {useClass: HashLocationStrategy})
41+
* ]);
3742
* ```
3843
*/
3944
@Injectable()

0 commit comments

Comments
 (0)