Repository navigation
fix(docs-infra): link directive selector aliases to the right API page - #71240
Open
erkamyaman wants to merge 1 commit into
Open
erkamyaman wants to merge 1 commit into
erkamyaman wants to merge 1 commit into
Conversation
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.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extractAliasesFromSelectorcollects every[attr]in a selector, including ones inside:not(...)and compound selectors, soNgModelandSelectMultipleControlValueAccessorboth claimngModel,formControlandformControlName.mapManifestToEntrieswrites aliases with no collision check, so the last claimant wins (SelectMultipleControlValueAccessor), and an alias can also delete a real entry, which is whyemail()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
emailjoins the names that are not linked on their own (required,min, ...).ngModelSelectMultipleControlValueAccessorNgModelformControlNameSelectMultipleControlValueAccessorFormControlNameformControlSelectMultipleControlValueAccessorFormControlDirectiverouterLinkRouterLinkWithHrefRouterLinkformGroup,formArrayNgFormFormGroupDirective,FormArrayDirectiveformGroupName,formArrayNameNgControlStatusGroupFormGroupName,FormArrayNamengForNgForOfNgForemail(),required(), ...forms/signals/*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).