fix(ivy): inject ViewContainerRef for directives on ng-container (#25617)
PR Close #25617
This commit is contained in:

committed by
Matias Niemelä

parent
18f129f536
commit
b00038c847
@ -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>';
|
||||
}
|
||||
|
Reference in New Issue
Block a user