New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ivy): support animation @triggers in templates #25849

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@matsko
Member

matsko commented Sep 7, 2018

No description provided.

@googlebot googlebot added the cla: yes label Sep 7, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Sep 7, 2018

if (rf & 2) {
$r3$.ɵelementAttribute(0, "@foo", $r3$.ɵbind(ctx.exp));
$r3$.ɵelementAttribute(1, "@bar", undefined);
$r3$.ɵelementAttribute(2, "@baz", undefined);

This comment has been minimized.

@JoostK

JoostK Sep 7, 2018

Contributor

I don't think this is desirable. If the value is constant (undefined) it shouldn't need to be reevaluated each update, should it? Also, because this doesn't use bind it will never be NO_CHANGE, in which case the attribute is thought to have changed during each change detection run.

This comment has been minimized.

@mhevery

mhevery Sep 7, 2018

Member

Yes, this test is not canonical, and will confuse people reading it. Can you make it canonical by binding to a value, which may be constant for the test.

This comment has been minimized.

@matsko

matsko Sep 7, 2018

Member

How's about just setting the undefined value to be NO_CHANGE?

This comment has been minimized.

@JoostK

JoostK Sep 7, 2018

Contributor

@matsko It won't do a thing, then ;) Basically, constant attributes are usually applied for RenderFlags.Create by passing the constant attributes as third argument to elementStart.

This comment has been minimized.

@matsko

matsko Sep 7, 2018

Member

OK the instructions are gone.

@mhevery

mhevery approved these changes Sep 7, 2018

Conditionally on the clean up comments.

const template = `
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
type: MyComponent,

This comment has been minimized.

@mhevery

mhevery Sep 7, 2018

Member

you can use ... to elide irrelevant text and only keep animations.

MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
 ...
  animations: [{name: "foo123"}, {name: "trigger123"}]
 ...
});
features: [$r3$.ɵPublicFeature],
consts: 0,
vars: 0,
template: function MyComponent_Template(rf, $ctx$) {

This comment has been minimized.

@mhevery

mhevery Sep 7, 2018

Member

same here, elide irrelevant text.

if (rf & 2) {
$r3$.ɵelementAttribute(0, "@foo", $r3$.ɵbind(ctx.exp));
$r3$.ɵelementAttribute(1, "@bar", undefined);
$r3$.ɵelementAttribute(2, "@baz", undefined);

This comment has been minimized.

@mhevery

mhevery Sep 7, 2018

Member

Yes, this test is not canonical, and will confuse people reading it. Can you make it canonical by binding to a value, which may be constant for the test.

@mary-poppins

This comment has been minimized.

mary-poppins commented Sep 7, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Sep 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment