fix(ivy): extend assertion in directiveInject function to support IcuContainers (#33832)

Prior to this commit the assert that we have in `directiveInject` (assert introduced recently) didn't include IcuContainer TNode type and as a result, the error is thrown in case pipes with dependencies are used inside ICUs. This commit extends the assert to allow for IcuContainer TNode types.

PR Close #33832
This commit is contained in:
Andrew Kushnir
2019-11-14 11:59:13 -08:00
committed by Alex Rickabaugh
parent a61fb76d51
commit 84524583e9
2 changed files with 37 additions and 1 deletions

View File

@ -47,7 +47,8 @@ export function ɵɵdirectiveInject<T>(
if (lView == null) return ɵɵinject(token, flags);
const tNode = getPreviousOrParentTNode();
ngDevMode && assertNodeOfPossibleTypes(
tNode, TNodeType.Container, TNodeType.Element, TNodeType.ElementContainer);
tNode, TNodeType.Container, TNodeType.Element, TNodeType.ElementContainer,
TNodeType.IcuContainer);
return getOrCreateInjectable<T>(
tNode as TDirectiveHostNode, lView, resolveForwardRef(token), flags);
}