Skip to content

CdkPortalOutlet should resolve componentFactories through the portal's ComponentFactoryResolver #9712

@j2L4e

Description

@j2L4e

Bug, feature request, or proposal:

At the moment, CdkPortal tries to resolve ComponentFactories via its own CFR which it got from its own Injector instance:

const componentFactory = this._componentFactoryResolver.resolveComponentFactory(portal.component);

It may happen that you'd like to attach a ComponentPortal with a lazily loaded entryComponent that's not resolvable through the PortalHost's CFR. It should then try to get a CFR instance from the Portal to resolve the ComponentFactory if it can't resolve it through its own:

const componentFactory = portal.injector.get(ComponentFactoryResolver).resolveComponentFactory(portal.component);

I'm not sure if this has any negative side effects.

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions