fix(core): provide NgModuleRef
in ViewContainerRef.createComponent
. (#15350)
This is needed to support the corner cases: - usage of a `ComponentFactory` that was created on the fly via `Compiler` - overwriting of the `NgModuleRef` that is associated to a `ComponentFactory` by the `ComponentFactoryResolver` from which it was read. Fixes #15241
This commit is contained in:

committed by
Miško Hevery

parent
8e6995c91e
commit
431eb309f3
@ -9,6 +9,7 @@
|
||||
import {Injector} from '../di/injector';
|
||||
import {ComponentFactory, ComponentRef} from './component_factory';
|
||||
import {ElementRef} from './element_ref';
|
||||
import {NgModuleRef} from './ng_module_factory';
|
||||
import {TemplateRef} from './template_ref';
|
||||
import {EmbeddedViewRef, ViewRef} from './view_ref';
|
||||
|
||||
@ -83,7 +84,7 @@ export abstract class ViewContainerRef {
|
||||
*/
|
||||
abstract createComponent<C>(
|
||||
componentFactory: ComponentFactory<C>, index?: number, injector?: Injector,
|
||||
projectableNodes?: any[][]): ComponentRef<C>;
|
||||
projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;
|
||||
|
||||
/**
|
||||
* Inserts a View identified by a {@link ViewRef} into the container at the specified `index`.
|
||||
|
Reference in New Issue
Block a user