🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@SkyZeroZx
Copy link
Contributor

@SkyZeroZx SkyZeroZx commented Dec 9, 2025

Implements a mechanism to extract alias names from a directive/component's selector.
The implementation started in #65571 is now complete, enabling the addition of aliases for Angular Aria and allowing automatic generation of links for entries such as ngToolbar.

@Directive({
  selector: '[ngToolbar]',

Then the output of entries should look something like this:

{
  "...",
  "entries": [
    {  
      "...",
      "aliases": ["ngToolbar"]
    }
  ]
}

@pullapprove pullapprove bot requested a review from mmalerba December 9, 2025 04:02
@SkyZeroZx SkyZeroZx force-pushed the docs/feat-aliases-parse branch from 29308d5 to 2b08496 Compare December 9, 2025 04:06
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: docs-infra Angular.dev application and infrastructure labels Dec 9, 2025
@ngbot ngbot bot added this to the Backlog milestone Dec 9, 2025
@JeanMeche JeanMeche requested review from JeanMeche and removed request for mmalerba December 9, 2025 17:22
@JeanMeche JeanMeche force-pushed the docs/feat-aliases-parse branch from 2b08496 to c22af99 Compare December 10, 2025 00:07
@JeanMeche
Copy link
Member

I think instead of relying on some extra jsdoc tags, we can be a bit smarter and extract them from the selector directly

eg:

  • [ngTabs] => ngTags
  • [input[ngComboboxInput] => ngComboboxInput
  • [ng-template[ngComboboxPopupContainer] => ngComboboxPopupContainer

@SkyZeroZx SkyZeroZx force-pushed the docs/feat-aliases-parse branch from c22af99 to 46e54a0 Compare December 10, 2025 16:19
* @param selector The CSS selector string from directive/component metadata
* @returns Array of attribute names that can be used as aliases
*/
function extractAliasesFromSelector(selector: string): string[] {
Copy link
Member

@JeanMeche JeanMeche Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add some test coverage for this.
The extractor tests are located at packages/compiler-cli/test/ngtsc/doc_extraction

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@github-actions
Copy link

Deployed adev-preview for 46e54a0 to: https://ng-dev-previews-fw--pr-angular-angular-65936-adev-prev-bpbj4xc1.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

Implements a mechanism to extract alias names from a directive/component's selector.
@SkyZeroZx SkyZeroZx force-pushed the docs/feat-aliases-parse branch from 46e54a0 to 4d9ea6b Compare December 10, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adev: preview area: docs-infra Angular.dev application and infrastructure detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants