import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'chipClass', standalone: true, }) export class ChipClassPipe implements PipeTransform { transform( i: number, chips: any[], chipToDelete: number ): { [key: string]: boolean } { return { 'first-chip-animation': i === 0 && chips[0]?.canDoAnimation, 'second-chip-animation': i === 1 && chips[1]?.canDoAnimation, 'third-chip-animation': i === 2 && chips[2]?.canDoAnimation, 'first-chip-toolbar-style': i === 0, 'second-chip-toolbar-style': i === 1, 'third-chip-toolbar-style': i === 2, 'delete-chip-style': chipToDelete === i, }; } }