fix(ivy): reflect animations field directly into the output definition (#26322)

The 'animations' field of @Component metadata should be copied directly
into the ngComponentDef for that component and should not pass through
static resolution.

Previously the animations array was statically resolved and then the
values were translated back when generating ngComponentDef.

PR Close #26322
This commit is contained in:
Alex Rickabaugh
2018-10-09 10:45:27 -07:00
committed by Jason Aden
parent 9623e7c639
commit 456f23f76a
5 changed files with 13 additions and 21 deletions

View File

@ -65,6 +65,9 @@ export function compileComponent(type: Type<any>, metadata: Component): void {
`Errors during JIT compilation of template for ${stringify(type)}: ${errors}`);
}
const animations =
metadata.animations !== null ? new WrappedNodeExpr(metadata.animations) : null;
// Compile the component metadata, including template, into an expression.
// TODO(alxhub): implement inputs, outputs, queries, etc.
const res = compileR3Component(
@ -76,8 +79,7 @@ export function compileComponent(type: Type<any>, metadata: Component): void {
viewQueries: [],
wrapDirectivesInClosure: false,
styles: metadata.styles || [],
encapsulation: metadata.encapsulation || ViewEncapsulation.Emulated,
animations: metadata.animations || null
encapsulation: metadata.encapsulation || ViewEncapsulation.Emulated, animations,
},
constantPool, makeBindingParser());
const preStatements = [...constantPool.statements, ...res.statements];