mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs: should not conditionally include <ng-content> in IMPORTANT block (#63580)
PR Close #63580
This commit is contained in:
committed by
Andrew Scott
parent
067a3a5a76
commit
a857f72c81
@@ -68,7 +68,7 @@ placeholder that tells Angular where to render content. Angular's compiler proce
|
||||
all `<ng-content>` elements at build-time. You cannot insert, remove, or modify `<ng-content>` at
|
||||
run time. You cannot add directives, styles, or arbitrary attributes to `<ng-content>`.
|
||||
|
||||
You should not conditionally include `<ng-content>` with `@if`, `@for`, or `@switch`. Angular always
|
||||
IMPORTANT: You should not conditionally include `<ng-content>` with `@if`, `@for`, or `@switch`. Angular always
|
||||
instantiates and creates DOM nodes for content rendered to a `<ng-content>` placeholder, even if
|
||||
that `<ng-content>` placeholder is hidden. For conditional rendering of component content,
|
||||
see [Template fragments](api/core/ng-template).
|
||||
|
||||
Reference in New Issue
Block a user