/** * @license * Copyright Google LLC 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 {Location, LocationStrategy, PathLocationStrategy} from '@angular/common'; import {Component} from '@angular/core'; @Component({ selector: 'path-location', providers: [Location, {provide: LocationStrategy, useClass: PathLocationStrategy}], template: `

PathLocationStrategy

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