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

102
Vistas
Move l l to ts/js angular file?

I need to set my logic in ts file. All logic need to be in ts file instead html. but in my situation logic is in html and i don;t know how to move to ts ? View html :

Maybe to create any function and set logic inside ts? Help how to do it ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There are couple of solutions to your situation:

  1. Using property - In your .ts file use property and update it at OnChanges or OrInit lifecycle hooks.
export class MyComponent implements OnChanges {
  showPassenger = false;

  ngOnChanges(): void {
    this.showPassenger = this.sortFilter?.includes('PassengerPriority');
  }
}
  1. Using Angular pipes - you can use some library like ng-pipes or implement one by yourself
about 4 years ago · Juan Pablo Isaza 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