fix(animations): ensure void => * animations are triggered when an expression is omitted

Closes #9327
Closes #9381
This commit is contained in:
Matias Niemelä
2016-06-21 13:56:25 -07:00
parent ed0ade6f34
commit e0b0a594bb
2 changed files with 49 additions and 0 deletions

View File

@ -562,6 +562,12 @@ class TemplateParseVisitor implements HtmlAstVisitor {
private _parseAnimation(
name: string, expression: string, sourceSpan: ParseSourceSpan,
targetMatchableAttrs: string[][], targetAnimationProps: BoundElementPropertyAst[]) {
// This will occur when a @trigger is not paired with an expression.
// For animations it is valid to not have an expression since */void
// states will be applied by angular when the element is attached/detached
if (!isPresent(expression) || expression.length == 0) {
expression = 'null';
}
var ast = this._parseBinding(expression, sourceSpan);
targetMatchableAttrs.push([name, ast.source]);
targetAnimationProps.push(new BoundElementPropertyAst(