UrlHandlingStrategy

class

npm Package @angular/router
Module import { UrlHandlingStrategy } from '@angular/router';
Source router/src/url_handling_strategy.ts

Provides a way to migrate AngularJS applications to Angular.

Overview

class UrlHandlingStrategy {
  shouldProcessUrl(url: UrlTree): boolean
  extract(url: UrlTree): UrlTree
  merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree
}

Members

shouldProcessUrl(url: UrlTree): boolean

Tells the router if this URL should be processed.

When it returns true, the router will execute the regular navigation. When it returns false, the router will set the router state to an empty state. As a result, all the active components will be destroyed.

extract(url: UrlTree): UrlTree

Extracts the part of the URL that should be handled by the router. The rest of the URL will remain untouched.

merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree

Merges the URL fragment with the rest of the URL.

© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/router/UrlHandlingStrategy