Angular 4 animate any changes in height / position with Angular animation

Pretty simple question, I hope. Is there a way to use angular syntax syntax to animate any changes in element height or position?

For example, if a DOM element is deleted, causing another element to move up, is it possible to animate the shift without setting a state variable?

<div [@positionChange]></div>

Or something like that without a state.

early.

+6
source share
1 answer

- , / . , .

trigger('fold', [
  transition(':enter', [style({height: 0, overflow: 'hidden'}), animate('.3s ease', style({height: '*'}))]),
  transition(':leave', [style({height: '*', overflow: 'hidden'}), animate('.3s ease', style({height: 0}))])
]);
+1

All Articles