Когда я устанавливаю анимацию внутри моего component.ts, я не получаю никаких ошибок. Но при экспорте анимации в отдельный файл я получаю ошибку, показанную ниже.
animations.ts
import { trigger, state, transition, style, animation, animate } from '@angular/animations';
export const transAnimation = animation([
trigger('fade', [
state('void', style({ opacity: 0 })),
transition(':enter', [
animate(300)
])
]),
trigger('fadeOut', [
state('void', style({ opacity: 0 })),
transition(':leave', [
animate(300)
])
]),
trigger('shake', [
state('false', style({ transform: 'translateX(10px)' })),
transition('0 => 1', [
animate(300)
])
]),
trigger('slideIn', [
state('void', style({ transform: 'translateX(10px)' })),
transition(':enter', [
animate(300)
])
]),
trigger('hideShow', [
state('false', style({ opacity: 0 })),
transition('0 => 1', animate(300)),
])
]);
component.ts
import { transAnimation } from '../../animations';
[enter image description here][1]
@Component({
selector: 'app-card-update',
templateUrl: './card-update.component.html',
styleUrls: ['./card-update.component.scss'],
animations: [transAnimation]
})