docs: show how to give projected content access to a view injector by arturovt · Pull Request #70584 · angular/angular · GitHub
Skip to content

docs: show how to give projected content access to a view injector - #70584

Open
arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:docs/projected-content-view-injector
Open

docs: show how to give projected content access to a view injector#70584
arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:docs/projected-content-view-injector

Conversation

@arturovt

@arturovt arturovt commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Content projected with <ng-content> resolves DI against the injector where it is declared, so it cannot reach the projecting component's viewProviders or component instances. Add a short recipe to the hierarchical injectors guide showing the supported alternative: accept the content as an <ng-template> and render it with ngTemplateOutletInjector.

Fixes #42649

Content projected with `<ng-content>` resolves DI against the injector
where it is declared, so it cannot reach the projecting component's
`viewProviders` or component instances. Add a short recipe to the
hierarchical injectors guide showing the supported alternative: accept the
content as an `<ng-template>` and render it with `ngTemplateOutletInjector`.

Fixes angular#42649
@pullapprove
pullapprove Bot requested a review from alan-agius4 September 5, 2026 19:07
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Sep 5, 2026
@ngbot ngbot Bot added this to the Backlog milestone Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Providers for content

1 participant