W3cubDocs

/Angular 2

UrlHandlingStrategy

Experimental Class

What it does

Provides a way to migrate Angular 1 applications to Angular 2.

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 @angular/router/index, defined in @angular/router/src/url_handling_strategy.ts

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