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

101
Views
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 answers
Answer question

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 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!