How to call a Ts function in angular without Ngif or click function?
My Answer is different from other implementations because I would suggest you to use a pipe instead of calling the method in your template :
<td>
{{ employee | employeePipe }}
</td>
And this how your epmloyee-pipe.ts looks :
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'employeePipe'
})
export class employeePipe implements PipeTransform {
transform(employee: EmployeeModel): string {
switch (employee.result) {
case 'Excellent' : return 'Fonctionnel';
case 'Good': return 'Technique';
default:
return 'Reject'
break;
}
return null;
}
}