Skip to content

Commit

Permalink
feat(docs): anchors are working with base href (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
Margar1ta authored and pimenovoleg committed Sep 3, 2019
1 parent 331b463 commit 17599eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/docs/src/app/components/anchors/anchors.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export class AnchorsComponent {
@Inject(DOCUMENT) private document: Document) {
this.currentUrl = router.url.split('#')[0];
this.container = '.anchors-menu';
this.pathName = location.pathname;
this.pathName = this.router.url;
this.router.events.pipe(takeUntil(this.destroyed)).subscribe((event) => {
if (event instanceof NavigationEnd) {
const rootUrl = router.url.split('#')[0];

if (rootUrl !== this.currentUrl) {
this.currentUrl = rootUrl;
this.pathName = location.pathname;
this.pathName = this.router.url;
}
}
});
Expand Down

0 comments on commit 17599eb

Please sign in to comment.