docs: fix the ng-container binding note in the templates guide

The guide said Angular ignores all attribute bindings and event listeners
on ng-container. The compiler now rejects attribute bindings on it, and a
directive host attribute binding fails at runtime. Property bindings only
work for directive inputs, and unknown ones are reported as errors.

Class bindings, style bindings, DOM event listeners and static attributes
are still ignored, so describe each case.

(cherry picked from commit b223af6b84)
This commit is contained in:
Kam
2026-11-03 16:38:34 -08:00
committed by Alex Rickabaugh
parent 26e622373f
commit 43bad26b73
@@ -22,7 +22,7 @@
You can apply directives to `<ng-container>` to add behaviors or configuration to a part of your template.
Angular ignores all attribute bindings and event listeners applied to `<ng-container>`, including those applied via directive.
Angular ignores class bindings, style bindings, DOM event listeners, and static attributes applied to `<ng-container>`, including those applied via directive. Attribute bindings cause errors, and property bindings only work for directive inputs.
## Using `<ng-container>` to display dynamic contents