Last active
February 14, 2019 11:36
-
-
Save mateothegreat/ff68c495976c5e5c62806644fc3a6edd to your computer and use it in GitHub Desktop.
Retrieve the hash value of a route (#myhash)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { ActivatedRoute } from '@angular/router'; | |
@Component({ | |
selector: 'app-awesome', | |
templateUrl: './app-awesome.component.html', | |
styleUrls: [ './app-awesome.component.scss' ] | |
}) | |
export class AwesomeComponent { | |
public constructor(private route: ActivatedRoute) { | |
route.fragment.subscribe((fragment: string) => { | |
console.log(fragment) | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment