angular-material2

How can I animate the icon in an expansion panel in Angular Material?

萝らか妹 提交于 2020-08-10 18:59:10
问题 I am trying animate an icon inside the title of an expansion panel. My HTML: <mat-expansion-panel-header> <mat-panel-title> <mat-icon [@openClose]="panelOpenState? 'open' : 'closed'">keyboard_arrow_up</mat-icon> Click me, all other animates </mat-panel-title> <mat-panel-description> Type your name and age </mat-panel-description> </mat-expansion-panel-header> My component: @Component({ selector: 'expansion-overview-example', animations: [ trigger('openClose', [ // ... state('open', style({