Get current route without parameters
问题 I need to get my current route without params in Angular 2, I found a way to get the current route with params as follows: this.router.url and then split it: this.router.url.split(';')[0] But this looks as workaround, I think there should be better way? 回答1: parseTree from Router helps fetching the segments without any knowledge about url structure. import { Router } from '@angular/router'; ... constructor(private router: Router) {} ... const urlTree = this.router.parseUrl(url); const