Closed shhdharmen closed 4 years ago
Hi @shhdharmen,
that's correct, fragment
wasn't considered as an alternative attribute to specify the scroll target besides href
, now it is (addressed in 10b8f80).
However, there's another problem with the example in your stackblitz: [routerLink]="'.'"
does not trigger a navigation event, although the library subscribes to it, as it detects a routerLink
to be present. Do you use routerLink
like that in your app as well or only in the stackblitz example?
Hi @Nolanus ,
Without [routerLink]="'.'"
, it fragment
won't work. And yes, I am using routerLink
like that in my app.
Ok, because the current check whether the library is on the correct page doesn't detect the dot-url .
:
this.router.isActive(this.router.parseUrl('.'), true) // always false
So I assume that this notation is not supported, and it doesn't trigger a router navigation due to unknown destination path, not because the dot-url is resolved to the current active path.
However, the check this.router.isActive(this.router.createUrlTree([]), true)
works and always returns true
, indicating that the correct way of navigating to the current route would be [routerLink]="[]"
.
Thanks.
Hello,
When we use
pageScroll
directive with[routerLink]
and[fragment]
, it doesn't work.Please see example on stackblitz: https://stackblitz.com/edit/angular-f2plax
Thanks.