I was able to get something similar to work (I'm using Angular 7) using the "sequence" method.
@Component({
selector: "app-keller-edit-audit",
templateUrl: "./keller-edit-audit.component.html",
styleUrls: ["./keller-edit-audit.component.less"],
animations: [
trigger("panelDoHideTrigger", [
// The final state of things if panel is hidden
state("true", style({ opacity: 0, display: "none" })),
// The final state of things if the panel is not hidden
state("false", style({ opacity: 1, display: "block" })),
// SHOW the panel
transition("true => false", [
// Use sequence to make steps go sequential
sequence(
[
// First flip the display to block so we can see the opacity fade in
style({ display: "block", opacity: 0.1 }),
// Now fade in using opacity
animate(500, style({ opacity: 1 }))
]
),
]),
// HIDE the panel
transition("false => true", [
animate(500, style({ opacity: 0 })),
]),
]),
],
})
...
...
...
<div class="col-xs-2">
<span *ngIf="ccg.DoHideDetail=='true'">
<a style="cursor:pointer" (click)="ccg.DoHideDetail='false'">Show Details</a>
</span>
<span *ngIf="ccg.DoHideDetail=='false'">
<a style="cursor:pointer" (click)="ccg.DoHideDetail='true'">Hide Details</a>
</span>
</div>
<div [@panelDoHideTrigger]="ccg.DoHideDetail" >
<ng-container *ngFor="let cc of ccg.AuditCycleCounts; let i2=index">