fix(compiler): create literal property bindings for empty *… directives.
Closes #4916
This commit is contained in:
parent
2957b0b32e
commit
b2dc5c2c7e
|
@ -272,6 +272,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
|
|||
targetMatchableAttrs, targetProps);
|
||||
} else {
|
||||
targetMatchableAttrs.push([dashCaseKey, '']);
|
||||
this._parseLiteralAttr(dashCaseKey, null, attr.sourceInfo, targetProps);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -670,6 +670,17 @@ There is no directive with "exportAs" set to "dirA" at TestComp > div:nth-child(
|
|||
[ElementAst, 'div', 'TestComp > div:nth-child(0)']
|
||||
]);
|
||||
});
|
||||
|
||||
it('should work with *... and empty value', () => {
|
||||
expect(humanizeTemplateAsts(parse('<div *ng-if>', [ngIf])))
|
||||
.toEqual([
|
||||
[EmbeddedTemplateAst, 'TestComp > div:nth-child(0)'],
|
||||
[DirectiveAst, ngIf, 'TestComp > div:nth-child(0)'],
|
||||
[BoundDirectivePropertyAst, 'ngIf', 'null', 'TestComp > div:nth-child(0)[*ng-if=]'],
|
||||
[ElementAst, 'div', 'TestComp > div:nth-child(0)']
|
||||
]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue