Skip to content

Instantly share code, notes, and snippets.

@benjamincharity
Created May 1, 2020 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamincharity/62a2d70f3d31c4d953afaab4a4fc7018 to your computer and use it in GitHub Desktop.
Save benjamincharity/62a2d70f3d31c4d953afaab4a4fc7018 to your computer and use it in GitHub Desktop.
<div [@detailExpand]="shouldExpand ? 'expanded' : 'collapsed'">
Test
</div>
@Component({
selector: 'foo',
templateUrl: './ep.html',
animations: [
trigger('detailExpand', [
state('collapsed', style({
height: '0',
minHeight: '0',
})),
state('expanded', style({ height: '*' })),
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
]),
],
})
export class Foo {
shouldExpand = fase;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment