We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
router
Consider the following example:
import { IsActiveMatchOptions } from '@angular/router'; class MyComponent { protected routerLinkMatchOptions: IsActiveMatchOptions = { queryParams: 'subset', fragment: 'exact', paths: 'exact', matrixParams: 'ignored' } }
<a routerLink="./" [routerLinkActiveOptions]="routerLinkMatchOptions" routerLinkActive="link-active"></a> <a routerLink="./" fragment="fragment1" [routerLinkActiveOptions]="routerLinkMatchOptions" routerLinkActive="link-active"></a>
If you go on the page ./, only the first link will get the link-active class. If you go on ./#fragment1, both links will get the link-active class.
./
link-active
./#fragment1
While that might be the desired effect for some, it is not necessarily always desired.
Add another option to IsActiveMatchOptions.fragment, like exact-required, that would say:
IsActiveMatchOptions.fragment
exact-required
fragment
Which would differ from the current exact that behaves like:
exact
Maybe this is a bug and the exact option should say "if there is no fragment, it is not exact, and therefore should not be a match"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Which @angular/* package(s) are relevant/related to the feature request?
router
Description
Consider the following example:
If you go on the page
./
, only the first link will get thelink-active
class. If you go on./#fragment1
, both links will get thelink-active
class.While that might be the desired effect for some, it is not necessarily always desired.
Proposed solution
Add another option to
IsActiveMatchOptions.fragment
, likeexact-required
, that would say:fragment
, it is a matchfragment
or does not have afragment
, it is not a matchWhich would differ from the current
exact
that behaves like:fragment
or does not have afragment
, it is a matchfragment
it is not a matchAlternatives considered
Maybe this is a bug and the
exact
option should say "if there is no fragment, it is not exact, and therefore should not be a match"The text was updated successfully, but these errors were encountered: