En primer lugar, importé BrowserAnimationsModule en mi profile.module.ts a mis animaciones para que funcionaran, pero arrojó un error de que BrowserModule se importó dos veces, pasé por problemas de GitHub y descubrí que debería importar BrowserModule y BrowserAnimationsModule solo una vez en mi aplicación. module.ts Pero la animación parece no funcionar en los componentes que se importan en profile.module.ts
estas son mis animaciones de mi componente que no funciona (el componente pertenece a profile.module.ts)
animations: [ trigger('animationOption2', [ transition(':enter', [ style({ backgroundColor: 'yellow' }), animate(300) ]), transition(':leave', [ animate(300, style({ backgroundColor: 'yellow' })) ]), state('*', style({ backgroundColor: 'green' })), ]) ]