I\'ve essentially run into this problem, where I need a reference to the current route to use gradients, but have yet to figure out how to translate the solution into Angula
You can use the DOCUMENT injection from @angular/common.
DOCUMENT
@angular/common
import { Component, Inject } from '@angular/core'; import { DOCUMENT } from '@angular/common'; @Component({...}) class SomeComponent { constructor(@Inject(DOCUMENT) document: any) { console.log(document.location.href); } }