Visitar URL original
fix(docs-infra): link directive selector aliases to the right API page by erkamyaman 路 Pull Request #71240 路 angular/angular 路 GitHub
Skip to content

fix(docs-infra): link directive selector aliases to the right API page - #71240

Open
erkamyaman wants to merge 1 commit into
angular:mainfrom
erkamyaman:fix-docs-infra-directive-alias-links
Open

erkamyaman wants to merge 1 commit into
angular:mainfrom
erkamyaman:fix-docs-infra-directive-alias-links

Conversation

@erkamyaman

Copy link
Copy Markdown
Contributor

extractAliasesFromSelector collects every [attr] in a selector, including ones inside :not(...) and compound selectors, so NgModel and SelectMultipleControlValueAccessor both claim ngModel, formControl and formControlName. mapManifestToEntries writes aliases with no collision check, so the last claimant wins (SelectMultipleControlValueAccessor), and an alias can also delete a real entry, which is why email() never linked.

Aliases are now collected per name. When several directives claim one, the one named after it wins, otherwise it stays unlinked. An alias never replaces a real entry, and email joins the names that are not linked on their own (required, min, ...).

Text Links to today Links to now Links Pages
ngModel SelectMultipleControlValueAccessor NgModel 56 13
formControlName SelectMultipleControlValueAccessor FormControlName 23 6
formControl SelectMultipleControlValueAccessor FormControlDirective 11 3
routerLink RouterLinkWithHref RouterLink 63 12
formGroup, formArray NgForm FormGroupDirective, FormArrayDirective 13 5
formGroupName, formArrayName NgControlStatusGroup FormGroupName, FormArrayName 5 1
ngFor NgForOf NgFor 6 4
email(), required(), ... not linked forms/signals/* 61 12

https://angular.dev/guide/forms/form-validation#:~:text=actor%2Dform%2Dtemplate.component.html%20(name)
Hovering [(ngModel)] in the form-validation guide, before (angular.dev) and after (this branch):

Screen.Recording.2026-10-07.at.22.16.21.mov

Diffed every link in the generated guide HTML before and after: 178 wrong links removed, 238 added. Four aliases now render unlinked (type, multiple, ngNoCva, ngNoForm).

Every `[attr]` in a directive selector is recorded as an alias, including
the ones inside `:not(...)`, and the last directive in the manifest won
the alias. `ngModel`, `formControl` and `formControlName` linked to
`SelectMultipleControlValueAccessor`, `routerLink` to the deprecated
`RouterLinkWithHref` and `formGroup` to `NgForm`. An alias could also
delete a real entry of the same name, so `email()` never linked.

Collect the claimants of each alias instead. When several directives
claim one, link the one named after it, otherwise leave the alias
unlinked. An alias no longer replaces a real entry. `email` joins the
names that are not linked on their own, so it does not link in code
samples.
@pullapprove
pullapprove Bot requested a review from atscott October 7, 2026 19:19
@angular-robot angular-robot Bot added the area: docs-infra Angular.dev application and infrastructure label Oct 7, 2026
@ngbot ngbot Bot added this to the Backlog milestone Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs-infra Angular.dev application and infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant