Angular Expand-Collapse Animation
This is a very short example to start with Angular animations
- Import
BrowserAnimationsModulein Module where you need the animation - Create your animation in a separate file, eg:
custom-animation.ts - Declare animation inside the
@Componentdecorator of the component using the animation → eg:animations: [customAnimation] - Attach the animation by its declared prefix on desired tag in component's html → eg:
<element *ngIf="isExpand" [@customAnimation]='isExpand'>