I'm using this @ngx-translate/core and @ngx-translate/http-loader i18n service and it works fine in templates (.html)
{{'title'|translate}}
Now I want to translate in my component typescript file (.ts) but I don't know how to use it.
I inject the translateService in contructor
constructor(private translate: TranslateService) {}
.component.ts
//update employee
editClick(item){
console.log(item);
this.emp=item;
this.ModalTitle="Edit Employee"; <-- Need to translate this using pipe
this.ActivateAddEditEmpComp=true;
}
//delete employee
deleteClick(item){
if(confirm('Are you sure??')){ <-- Need to translate this using pipe
this.service.deleteEmployee(item.EmployeeId).subscribe(data=>{
alert(data.toString());
this.refreshEmpList();
})
}
}