fix(ivy): inject ViewContainerRef for directives on ng-container (#25617)

PR Close #25617
This commit is contained in:
Pawel Kozlowski
2018-08-22 17:18:03 +02:00
committed by Matias Niemelä
parent 18f129f536
commit b00038c847
3 changed files with 52 additions and 3 deletions

View File

@ -17,7 +17,9 @@ export function assertNodeType(node: LNode, type: TNodeType) {
export function assertNodeOfPossibleTypes(node: LNode, ...types: TNodeType[]) {
assertDefined(node, 'should be called with a node');
const found = types.some(type => node.tNode.type === type);
assertEqual(found, true, `Should be one of ${types.map(typeName).join(', ')}`);
assertEqual(
found, true,
`Should be one of ${types.map(typeName).join(', ')} but got ${typeName(node.tNode.type)}`);
}
function typeName(type: TNodeType): string {
@ -25,5 +27,6 @@ function typeName(type: TNodeType): string {
if (type == TNodeType.Container) return 'Container';
if (type == TNodeType.View) return 'View';
if (type == TNodeType.Element) return 'Element';
if (type == TNodeType.ElementContainer) return 'ElementContainer';
return '<unknown>';
}