, :
import { trigger, animate, transition, style } from '@angular/animations';
export const myAnimation =
trigger('visibilityChanged', [
state('true' , style({ opacity: 1, transform: 'scale(1.0)' })),
state('false', style({ opacity: 0, transform: 'scale(0.0)' })),
transition('1 => 0', animate('300ms')),
transition('0 => 1', animate('900ms'))
]);
, :
import { fadeAnimation } from 'LOCALIZATION_OF_IT';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
animations: [fadeAnimation]
})