Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
Adición de animaciones a componentes enrutados en eventos de enrutamiento

Estoy tratando de que cuando el usuario cambie de pestaña, se deslice entre ellas.

Estoy usando animate.css y la versión 4 de Angular2.

Detecto el cambio de enrutador y agrego la animación así:

 this.router.events.pairwise().filter((e) => e[0] instanceof NavigationEnd && e[1] instanceof NavigationStart).subscribe((e: [NavigationStart, NavigationEnd]) => { $("#home").addClass("animated slideOutRight").one("animationend", function() { $(this).removeClass("animated slideOutRight"); }) $("#about").addClass("animated slideInLeft").one("animationend", function() { $(this).removeClass("animated slideInLeft"); }) });

donde #home y #about son los componentes a los que se enrutan. Esos dos identificadores se colocan para cubrir HomeComponent y AboutComponent.

 { path: 'home', component: HomeComponent }, { path: 'about', component: AboutComponent },

La animación funciona cuando se usa algo que no está en <router-outlet> (por ejemplo, cuando se usa $("body") ), así que supongo que debo hacer algo diferente con los componentes del enrutador.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!