refactor(views): split ViewManager/ViewContainerRef.createView into 2 methods
BREAKING CHANGES: `ViewManager.createView` / `ViewContainerRef.create` have been split into 2 methods: - `createHostView` which takes dynamically created bindings - `createEmbeddedView` which takes the newly introduced `TemplateRef` The new type `TemplateRef` is the combination of a `ProtoViewRef` and and `ElementRef` from the same place. Use `TemplateRef` when working with embedded views in `ng-if`, `ng-for`, ... instead of `ProtoViewRef`. Also, `ProtoViewRef` is no more injectable, but `TemplateRef` is. First part of #1989 to clean up manual content projection. Closes #3114
This commit is contained in:
@@ -146,8 +146,8 @@ export class Compiler {
|
||||
return this._compileNestedProtoViews(hostRenderPv, protoView, componentType);
|
||||
});
|
||||
}
|
||||
return hostPvPromise.then(hostAppProtoView => this._mergeCyclicEmbeddedProtoViews().then(
|
||||
_ => new ProtoViewRef(hostAppProtoView)));
|
||||
return hostPvPromise.then(
|
||||
hostAppProtoView => this._mergeCyclicEmbeddedProtoViews().then(_ => hostAppProtoView.ref));
|
||||
}
|
||||
|
||||
private _compile(componentBinding: DirectiveBinding): Promise<AppProtoView>| AppProtoView {
|
||||
|
||||
Reference in New Issue
Block a user