Skip to content

Adding property/event bindings to ng-content should error #24259

Closed as not planned

Description

@jelbourn

Issue

Adding property/event bindings to <ng-content> (attributes that are not explicitly supported APIs) currently no-op. They should be an error, as the attributes will be completely lost.

Reproduction

https://stackblitz.com/edit/angular-gitter-hm6egs?file=app%2Fapp.component.ts

Activity

  1. changed the title [-]Adding unsupported attributes to ng-content should error[/-] [+]Adding property/event bindings to ng-content should error[/+] on Jun 1, 2018
  2. vicb commented on Jun 1, 2018

    @vicb
    Contributor

    Adding an attribute could be used for re-projection: <ng-content selector="a[title]" someRandomName></ng-content> and then <ng-content selector="[someRandomName]"></ng-content>

  3. added this to the Backlog milestone on Jun 1, 2018
  4. modified the milestones: Backlog, Ivy on Jun 1, 2018
  5. added a commit that references this issue on May 13, 2026
    f825e73
  6. JeanMeche commented on Aug 16, 2026

    @JeanMeche
    Member

    Closing as we've suggested this could be handled by a linting rule: #68910

  7. angular-automatic-lock-bot commented on Oct 20, 2026

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions