Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular attributes produce HTML validation errors #55354

Open
johnnygerard opened this issue Apr 15, 2024 · 3 comments
Open

Angular attributes produce HTML validation errors #55354

johnnygerard opened this issue Apr 15, 2024 · 3 comments
Labels
area: core Issues related to the framework runtime
Milestone

Comments

@johnnygerard
Copy link
Contributor

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

Angular uses non standard attributes which produce HTML validation errors such as:

  • Attribute _ngcontent-ng-c3135559882 not allowed on element input at this point.
  • Attribute ng-reflect-model not allowed on element input at this point.

Why not use data-* attributes?

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

@JoostK
Copy link
Member

JoostK commented Apr 16, 2024

There have been numerous issues around this, e.g. #15891 and #25355, with #40595 as an attempt to change the _ngcontent attributes into data attributes. Note that ng-reflect attributes are dev-only.

With the rise of SSR I can see some point of addressing it, but this may not just be a matter of changing the attribute names due to potential breakages.

@JoostK JoostK added the area: server Issues related to server-side rendering label Apr 16, 2024
@ngbot ngbot bot added this to the needsTriage milestone Apr 16, 2024
@JoostK
Copy link
Member

JoostK commented Apr 16, 2024

Labeling as "server" since this should only be relevant for SSR, as normally only the DOM has these attributes.

@johnnygerard
Copy link
Contributor Author

My issue is not about SSR but really about HTML validation.

The argument I read in your mentioned issues is that HTML validation does not apply to the DOM, but only the source HTML.

If we agree that valid HTML is desirable, even for an Angular application, then the question becomes:
How to best validate the Angular templates?

@alan-agius4 alan-agius4 added area: core Issues related to the framework runtime and removed area: server Issues related to server-side rendering labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues related to the framework runtime
Projects
None yet
Development

No branches or pull requests

3 participants