/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // #docregion LocationComponent import {HashLocationStrategy, Location, LocationStrategy} from '@angular/common'; import {Component} from '@angular/core'; @Component({ selector: 'hash-location', providers: [Location, {provide: LocationStrategy, useClass: HashLocationStrategy}], template: `

HashLocationStrategy

Current URL is: {{location.path()}}
Normalize: /foo/bar/ is: {{location.normalize('foo/bar')}}
` }) export class HashLocationComponent { location: Location; constructor(location: Location) { this.location = location; } } // #enddocregion