docs(router): Updated example for hash location strategy

Closes #5010
This commit is contained in:
Brandon Roberts 2015-10-29 07:30:05 -05:00 committed by Brandon
parent a87c5d989c
commit c17c33ca14

View File

@ -15,12 +15,14 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
* ### Example * ### Example
* *
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component, provide} from 'angular2/angular2';
* import { * import {
* ROUTER_DIRECTIVES, * ROUTER_DIRECTIVES,
* ROUTER_PROVIDERS, * ROUTER_PROVIDERS,
* RouteConfig, * RouteConfig,
* Location * Location,
* LocationStrategy,
* HashLocationStrategy
* } from 'angular2/router'; * } from 'angular2/router';
* *
* @Component({directives: [ROUTER_DIRECTIVES]}) * @Component({directives: [ROUTER_DIRECTIVES]})
@ -33,7 +35,10 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
* } * }
* } * }
* *
* bootstrap(AppCmp, [ROUTER_PROVIDERS]); * bootstrap(AppCmp, [
* ROUTER_PROVIDERS,
* provide(LocationStrategy, {useClass: HashLocationStrategy})
* ]);
* ``` * ```
*/ */
@Injectable() @Injectable()