fix(compiler): create literal property bindings for empty *… directives.

Closes #4916
This commit is contained in:
Tobias Bosch 2015-10-26 13:22:45 -07:00
parent 2957b0b32e
commit b2dc5c2c7e
2 changed files with 12 additions and 0 deletions

View File

@ -272,6 +272,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
targetMatchableAttrs, targetProps);
} else {
targetMatchableAttrs.push([dashCaseKey, '']);
this._parseLiteralAttr(dashCaseKey, null, attr.sourceInfo, targetProps);
}
}
return true;

View File

@ -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)']
]);
});
});
});