Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

193
Visualizações
Angular transition reverting to default state

I have a transition as defined below but the transition goes back to it's default state. I need my div tag to slide left on increment and slide right on decrement

animations: [
    trigger('animSlider', [
      transition(':decrement', [
        animate('300ms ease-out', style({ transform: 'translateX(200px)' }))
      ]),
      transition(':increment', [
        animate('300ms ease-out', style({ transform: 'translateX(-200px)' })),
      ]),
    ]),
  ]

Here's my html snippet

<figcaption class="image-overlay">
  <button (click)="onPrevious(image)" mat-icon-button class="slider-button prev" color="primary" [disabled]="image.index === 0"><mat-icon>navigate_before</mat-icon></button>
  <div [@animSlider]="image.index" class="image-title-choices">
    <div *ngFor="let title of imageTitles; let i = index"  class="image-title-choice-hold" fxLayout="row" fxLayoutAlign="center">
      <span>{{ title }}</span>
    </div>
  </div>
  <button (click)="onNext(image)" [disabled]="image.index === imageTitles.length" mat-icon-button class="slider-button next" color="primary"><mat-icon>navigate_next</mat-icon></button>
</figcaption>

and here is GIF of what is happening. It should switching to the next work, but it is not.

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda