fix(ivy): o2+ should work with multiple template instances (#22075)

Closes #22075
This commit is contained in:
Kara
2018-02-13 10:24:41 -08:00
committed by Miško Hevery
parent 8ec21fc325
commit 5e4af7c550
6 changed files with 505 additions and 322 deletions

View File

@ -499,8 +499,7 @@ export function createTView(): TView {
contentCheckHooks: null,
viewHooks: null,
viewCheckHooks: null,
destroyHooks: null,
objectLiterals: null
destroyHooks: null
};
}
@ -1736,6 +1735,12 @@ function valueInData<T>(data: any[], index: number, value?: T): T {
return value !;
}
/** Gets the binding at the current bindingIndex */
export function peekBinding(): any {
ngDevMode && assertNotEqual(currentView.bindingStartIndex, null, 'bindingStartIndex');
return data[bindingIndex];
}
export function getCurrentQueries(QueryType: {new (): LQueries}): LQueries {
return currentQueries || (currentQueries = new QueryType());
}
@ -1748,10 +1753,6 @@ export function getRenderer(): Renderer3 {
return renderer;
}
export function getTView(): TView {
return currentView.tView;
}
export function getDirectiveInstance<T>(instanceOrArray: T | [T]): T {
// Directives with content queries store an array in data[directiveIndex]
// with the instance as the first index