Skip to content

Add extended template diagnostic to make sure ngSkipHydration is not a binding #49501

@AndrewKushnir

Description

@AndrewKushnir

Which @angular/* package(s) are relevant/related to the feature request?

core

Description

The ngSkipHydration is a special attribute that instructs Angular that hydration logic should be skipped for a given component, for example:

<cmp ngSkipHydration />

Angular expects this attribute to be known statically (i.e. it can not be a binding) and also it can not have values other than "true" or an empty value. This would be covered in documentation, but it'd be also great to add a template diagnostic to make sure that:

  • a node doesn't have the ngSkipHydration in bindings
  • the value of the ngSkipHydration is within the allowed range (['true', '' /* empty string */])

The implementation would likely be very similar to the TextAttributeNotBindingSpec check.

Also related PR with a runtime check: #49500.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions