refactor(ivy): remove directive references from template (#22986)

PR Close #22986
This commit is contained in:
Kara Erickson
2018-03-25 21:32:39 -07:00
committed by Matias Niemelä
parent 2aabbc51fa
commit 910a16a1ff
48 changed files with 1734 additions and 1278 deletions

View File

@ -21,7 +21,10 @@ export class ViewRef<T> implements viewEngine_EmbeddedViewRef<T> {
constructor(private _view: LView, context: T|null, ) { this.context = context !; }
/** @internal */
_setComponentContext(context: T) { this.context = context; }
_setComponentContext(view: LView, context: T) {
this._view = view;
this.context = context;
}
destroy(): void { notImplemented(); }
destroyed: boolean;
@ -223,9 +226,9 @@ export class EmbeddedViewRef<T> extends ViewRef<T> {
* @param context The context for this view
* @returns The ViewRef
*/
export function createViewRef<T>(view: LView, context: T): ViewRef<T> {
export function createViewRef<T>(view: LView | null, context: T): ViewRef<T> {
// TODO: add detectChanges back in when implementing ChangeDetectorRef.detectChanges
return addDestroyable(new ViewRef(view, context));
return addDestroyable(new ViewRef(view !, context));
}
/** Interface for destroy logic. Implemented by addDestroyable. */