Skip to content

fix: ng-content with bound attributes like [select] now passes attrs to projection instruction#22

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/ng-content-bound-select-attrs
Feb 10, 2026
Merged

fix: ng-content with bound attributes like [select] now passes attrs to projection instruction#22
Brooooooklyn merged 1 commit into
mainfrom
fix/ng-content-bound-select-attrs

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 10, 2026

Angular's r3_template_transform.ts converts ALL raw HTML attributes on ng-content to TextAttributes, including binding syntax like [select]="...". OXC was only using categorized text attributes, dropping bound attributes entirely.


Note

Medium Risk
Changes how ng-content attributes are serialized into projection instructions, which can affect generated template code and content projection behavior. Scope is localized to ng-content handling and is covered by new integration tests/snapshots.

Overview
Aligns ng-content lowering with Angular by serializing all raw HTML attributes on ng-content into R3Content.attributes, including bracketed/bound forms like [select], instead of only previously-categorized text/template attrs.

Explicitly filters out i18n/i18n-* attributes from the projection attribute list (matching Angular’s pre-processing), and adds integration tests plus a new snapshot covering bound [select] behavior and i18n exclusion.

Written by Cursor Bugbot for commit 2c7d53c. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread crates/oxc_angular_compiler/src/transform/html_to_r3.rs
…to projection instruction

Angular's r3_template_transform.ts converts ALL raw HTML attributes on ng-content
to TextAttributes, including binding syntax like [select]="...". OXC was only using
categorized text attributes, dropping bound attributes entirely.

Exclude i18n/i18n-* attributes since Angular's I18nMetaVisitor strips these from
element.attrs before r3_template_transform runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn force-pushed the fix/ng-content-bound-select-attrs branch from d8a82ef to 2c7d53c Compare February 10, 2026 11:59
@Brooooooklyn Brooooooklyn merged commit 21903be into main Feb 10, 2026
3 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/ng-content-bound-select-attrs branch February 10, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant