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:
Tobias Bosch
2017-03-21 08:15:10 -07:00
committed by Miško Hevery
parent 8e6995c91e
commit 431eb309f3
6 changed files with 160 additions and 15 deletions

View File

@ -1086,7 +1086,7 @@ export declare abstract class ViewContainerRef {
readonly abstract length: number;
readonly abstract parentInjector: Injector;
abstract clear(): void;
abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][]): ComponentRef<C>;
abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;
abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
abstract detach(index?: number): ViewRef;
abstract get(index: number): ViewRef;