I am working with Angular 6 project in which I have disabled/removed hash-location-strategy which removes # from URL.
due to this change the link having:
<
This is for Angular 9, but, I am sure the community will benefit this,
You can use Location in the @angular/common to get the current path.
Let's say you have the following element with an id to focus
I am only showing extracted code blocks here. I am sure this will help someone :) Cheers.import { Location } from '@angular/common';
constructor(private location: Location) { }
this.location.path() + '#bring-me-to-the-focus';