Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Motivation:
- the content of ng-template will get the injector from the component, where is the defined, not "instanced"
- to change this behavior we have ngTemplateOutletInjector
- we usually need to get the injector of the component, where we are projecting the template into
- we cannot read the injector via ViewChild.read so we have to workaround this limitation with directive injectore
Usage:
- there is 100% need of this for writing of the Wrapper components around 3rd party components, which support custom templates (for example dropdowns and tables in Material / PrimeNG / Kendo etc)
PLEASE CHECK this stackblitz:
https://stackblitz.com/edit/angular-ivy-5s8bhd?file=src/app/wrapper/wrapper.component.ts
There is Original and OriginalChild component - to simulate 3rd party components... For the instance... and pSortColumn directives from PrimeNG https://www.primefaces.org/primeng/table - pSortColumn has to get Table component via its constructor)
Proposed solution
ViewChild(ren)/ContentChild(ren) should provida injector via { read: Injector } options.
Alternatives considered
Workaround via directive on the element.
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Motivation:
Usage:
PLEASE CHECK this stackblitz:
https://stackblitz.com/edit/angular-ivy-5s8bhd?file=src/app/wrapper/wrapper.component.ts
There is Original and OriginalChild component - to simulate 3rd party components... For the instance... and pSortColumn directives from PrimeNG https://www.primefaces.org/primeng/table - pSortColumn has to get Table component via its constructor)
Proposed solution
ViewChild(ren)/ContentChild(ren) should provida injector via { read: Injector } options.
Alternatives considered
Workaround via directive on the element.