|
|
|
@ -95,7 +95,10 @@ export class TemplateProjectionStrategy<T extends TemplateRef<any>> extends Proj
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const PROJECTION_STRATEGY = {
|
|
|
|
|
AppendComponentToBody<T extends Type<unknown>>(component: T, context?: InferredInstanceOf<T>) {
|
|
|
|
|
AppendComponentToBody<T extends Type<unknown>>(
|
|
|
|
|
component: T,
|
|
|
|
|
context?: Partial<InferredInstanceOf<T>>,
|
|
|
|
|
) {
|
|
|
|
|
return new RootComponentProjectionStrategy<T>(
|
|
|
|
|
component,
|
|
|
|
|
context && CONTEXT_STRATEGY.Component(context),
|
|
|
|
@ -104,7 +107,7 @@ export const PROJECTION_STRATEGY = {
|
|
|
|
|
AppendComponentToContainer<T extends Type<unknown>>(
|
|
|
|
|
component: T,
|
|
|
|
|
containerRef: ViewContainerRef,
|
|
|
|
|
context?: InferredInstanceOf<T>,
|
|
|
|
|
context?: Partial<InferredInstanceOf<T>>,
|
|
|
|
|
) {
|
|
|
|
|
return new ComponentProjectionStrategy<T>(
|
|
|
|
|
component,
|
|
|
|
@ -115,7 +118,7 @@ export const PROJECTION_STRATEGY = {
|
|
|
|
|
AppendTemplateToContainer<T extends TemplateRef<unknown>>(
|
|
|
|
|
templateRef: T,
|
|
|
|
|
containerRef: ViewContainerRef,
|
|
|
|
|
context?: InferredContextOf<T>,
|
|
|
|
|
context?: Partial<InferredContextOf<T>>,
|
|
|
|
|
) {
|
|
|
|
|
return new TemplateProjectionStrategy<T>(
|
|
|
|
|
templateRef,
|
|
|
|
@ -126,7 +129,7 @@ export const PROJECTION_STRATEGY = {
|
|
|
|
|
PrependComponentToContainer<T extends Type<unknown>>(
|
|
|
|
|
component: T,
|
|
|
|
|
containerRef: ViewContainerRef,
|
|
|
|
|
context?: InferredInstanceOf<T>,
|
|
|
|
|
context?: Partial<InferredInstanceOf<T>>,
|
|
|
|
|
) {
|
|
|
|
|
return new ComponentProjectionStrategy<T>(
|
|
|
|
|
component,
|
|
|
|
@ -137,7 +140,7 @@ export const PROJECTION_STRATEGY = {
|
|
|
|
|
PrependTemplateToContainer<T extends TemplateRef<unknown>>(
|
|
|
|
|
templateRef: T,
|
|
|
|
|
containerRef: ViewContainerRef,
|
|
|
|
|
context?: InferredContextOf<T>,
|
|
|
|
|
context?: Partial<InferredContextOf<T>>,
|
|
|
|
|
) {
|
|
|
|
|
return new TemplateProjectionStrategy<T>(
|
|
|
|
|
templateRef,
|
|
|
|
@ -148,7 +151,7 @@ export const PROJECTION_STRATEGY = {
|
|
|
|
|
ProjectComponentToContainer<T extends Type<unknown>>(
|
|
|
|
|
component: T,
|
|
|
|
|
containerRef: ViewContainerRef,
|
|
|
|
|
context?: InferredInstanceOf<T>,
|
|
|
|
|
context?: Partial<InferredInstanceOf<T>>,
|
|
|
|
|
) {
|
|
|
|
|
return new ComponentProjectionStrategy<T>(
|
|
|
|
|
component,
|
|
|
|
@ -159,7 +162,7 @@ export const PROJECTION_STRATEGY = {
|
|
|
|
|
ProjectTemplateToContainer<T extends TemplateRef<unknown>>(
|
|
|
|
|
templateRef: T,
|
|
|
|
|
containerRef: ViewContainerRef,
|
|
|
|
|
context?: InferredContextOf<T>,
|
|
|
|
|
context?: Partial<InferredContextOf<T>>,
|
|
|
|
|
) {
|
|
|
|
|
return new TemplateProjectionStrategy<T>(
|
|
|
|
|
templateRef,
|
|
|
|
|