Skip to content
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

Animation trigger with params won't work without a value #25588

Open
jpzwarte opened this issue Aug 21, 2018 · 1 comment
Open

Animation trigger with params won't work without a value #25588

jpzwarte opened this issue Aug 21, 2018 · 1 comment
Labels
area: animations freq2: medium P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Milestone

Comments

@jpzwarte
Copy link


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

So i have the following template:

    <div *ngFor="let image of chapterImages | async"
         [@image]="chapterAnimation">...</div>

And in the component:

  animations: [
    trigger('image', [
      transition(':enter', [
        style({ transform: 'translateX({{enter}})' }),
        animate('0.7s ease-in-out', style({ transform: 'translateX(0)' }))
      ], { params: { enter: '0%' } }),
      transition(':leave', [
        style({ transform: 'translateX(0)' }),
        animate('0.7s ease-in-out', style({ transform: 'translateX({{leave}})' }))
      ], { params: { leave: '-100%' } })
    ])
  ]
  chapterAnimation = {
    value: 'foo',
    params: {
      enter: '100%',
      leave: '-100%'
    }
  };

If i leave out the value: 'foo' line, the animation WILL NOT use the provided params and just use the default params. That is the bug (took me quite a while to figure out).

Angular 6.0.7

@jpzwarte
Copy link
Author

cc @matsko

@ngbot ngbot bot added this to the needsTriage milestone Aug 21, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Sep 27, 2018
@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed severity3: broken labels Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: animations freq2: medium P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

No branches or pull requests

4 participants