Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
Angular2 animation rotate direction?

I have a menu icon within Angular2, which should always rotates clockwise. When show, it should rotates from -360 degree to -180 degree. When hide, it should rotates from -180 degree to 0 degree.

But with this animation settings it rotates counterclockwise with transition state 'hide' to 'show'. How can I make it rotate clockwise?

export const MenuButtonAnimation = trigger('menuState', [
        state('hide', style({ transform: 'rotate(0)' })),
        state('show', style({ transform: 'rotate(-180deg)' })),
        transition('hide => show', animate('350ms ease-out')),
        transition('show => hide', animate('350ms ease-in'))
    ]);
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Add style { transform: 'rotate(-360deg)' } for 'hide => show', to properly hint browser to treat 0 deg as -360 deg (although they are logically the same).

export const MenuButtonAnimation = trigger('menuState', [
        state('hide', style({ transform: 'rotate(0)' })),
        state('show', style({ transform: 'rotate(-180deg)' })),
        transition('hide => show', [style({transform: 'rotate(-360deg)'}), animate('350ms ease-out')]),
        transition('show => hide', animate('350ms ease-in'))
    ]);
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda