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

131
Views
Deshabilitar la animación en Angular 2 Material

Mi pregunta es ¿cómo podemos deshabilitar la animación de botones o casillas de verificación en widgets de material angular?

Hay algunas soluciones css para anular la transición sin ninguna, pero no funciona.

Gracias,

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Puede deshabilitar la animación usando la propiedad @.disabled que se introdujo en angular 4.3.1 .

Agregue el siguiente código a su componente

 @HostBinding('@.disabled') disabled = true

o en tu html

 <div [@.disabled]="expression"></div>

Aquí está trabajando plnkr https://plnkr.co/edit/sVJM8H?p=preview

about 4 years ago · Santiago Trujillo Report

0

prueba esto:

 <mat-group [@.disabled]="true"> <mat-tab label="one">one</mat-tab> <mat-tab label="two">two</mat-tab> <mat-tab label="three">three</mat-tab> </mat-group>
about 4 years ago · Santiago Trujillo Report

0

Otro enfoque es un truco con navegación de ruta (busque un lugar más tarde para cambiar el valor devuelto)

 this.router.routeReuseStrategy.shouldReuseRoute = function() { return false; }; this.router.navigate(['your-page', nextTabIndex]);

Esto será lo mismo que la condición *ngIf pero también es importante definir un parámetro de ruta, por ejemplo, :tab

 { path: 'your-path/:tab', component: YourComponent }

Y, por supuesto, debe usar <route-outlet></route-outlet>

Y también sería bueno restaurar la pestaña actual en la recarga de la página

 tab: number = 0; constructor(public router: Router, public route: ActivatedRoute) {} ngOnInit() { this.tab = this.route.snapshot.params['tab']; } onTab(event: MatTabChangeEvent) { this.tab = event.index; this.router.routeReuseStrategy.shouldReuseRoute = function() { return false; }; const url = decodeURIComponent(this.router.url); this.router.navigate([url.substr(0, url.lastIndexOf("/")), event.index]); }

y en html

 <mat-tab-group [selectedIndex]="tab" (selectedTabChange)="onTab($event)"/>
about 4 years ago · Santiago Trujillo Report
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!