fix: ng-content with bound attributes like [select] now passes attrs to projection instruction#22
Merged
Conversation
There was a problem hiding this comment.
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.
…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>
d8a82ef to
2c7d53c
Compare
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.
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-contentattributes are serialized into projection instructions, which can affect generated template code and content projection behavior. Scope is localized tong-contenthandling and is covered by new integration tests/snapshots.Overview
Aligns
ng-contentlowering with Angular by serializing all raw HTML attributes onng-contentintoR3Content.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.