Skip to content

Conversation

@JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Jan 4, 2026

This is to improve consistency and match developer expectations.
This syntax was already deprecated a long time ago.
If you want to bind a data attribute, use the attr. prefix (which was already supported).

Examples like following will now produce a compilation error:

data-id="{{1}}"
data-[type]="'button'"

And should be replace by their respective input syntax (without the data- prefix)

BREAKING CHANGE: data prefixed attribute no-longer bind inputs nor outputs.

fixes #26406


What still works:

  • bind-foo="someProp" binds somProp to the foo input
  • on-foo="fooMethod()" will hook up a listener with fooMethod

This is to improve consistency and match developer expectations. This syntax was already deprecated a long time ago.
If you want to bind a data attribute, use the `attr.` prefix (which was already supported).

BREAKING CHANGE: data prefixed attribute no-longer bind inputs nor outputs.

fixes angular#26406
@JeanMeche JeanMeche added target: major This PR is targeted for the next major release state: blocked on G3 cleanup This change requires a G3 cleanup labels Jan 4, 2026
@angular-robot angular-robot bot added detected: breaking change PR contains a commit with a breaking change area: compiler Issues related to `ngc`, Angular's template compiler labels Jan 4, 2026
@JeanMeche JeanMeche added this to the v22 candidates milestone Jan 4, 2026
@ngbot ngbot bot modified the milestones: v22 candidates, Backlog Jan 4, 2026
@JeanMeche JeanMeche modified the milestones: Backlog, v22 candidates Jan 5, 2026
@JeanMeche JeanMeche added breaking changes and removed detected: breaking change PR contains a commit with a breaking change state: blocked on G3 cleanup This change requires a G3 cleanup labels Jan 9, 2026
@JeanMeche
Copy link
Member Author

G3 has been cleaned-up.
Since this is a breaking change, we'll have to wait for the breaking change window of v22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler breaking changes target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data- prefix gets stripped from bindings such as <div data-id="{{1}}">

1 participant