I'm trying to animate a row in mat-table when it's added or when it's changed. I have the following animations:
import { animate, keyframes, sequence, style, transition, trigger } from '@angular/animations';
export const rowUpdate =
trigger('rowUpdate', [
transition('void => *', animate('5000ms', keyframes([
style({backgroundColor: 'initial', boxShadow: 'none', offset: 0} ),
style({backgroundColor: 'red', boxShadow: '0 0 5px red', offset: 0.1} ),
style({backgroundColor: 'initial', boxShadow: 'none', offset: 1} ),
])))
]);
And I call it on HTML:
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [@rowUpdate]="">
When i change or update a row It works propertly, the problem is that I can hide/show columns and when I add a new column all table highlight and I want that this occurs only when I add/change row, not when I add new columns.
Any idea of how could I control this?
EDIT 1: I've tried this solution to: hightlight via css
But I've another problem, when I sort the table the animation appears again and I don't want it. I've tried to delete the class but I'm not able.