W3cubDocs

/Angular 4 TypeScript

UrlHandlingStrategy

Experimental Class

What it does

Provides a way to migrate AngularJS applications to Angular.

Class Overview

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

Class Description

Class Details

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.

exported from router/index, defined in router/src/url_handling_strategy.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/router/index/UrlHandlingStrategy-class.html