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 ?
There are couple of solutions to your situation:
.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');
}
}