I am using ng2-translate on my ionic2 app, and it's working nicely on static text on html files:
<button ion-item *ngFor="let examTaken of examTakenList" (click)="selectExamTaken(examTaken)">
{{'menu.'+examTaken.name | translate }} - {{examTaken.createdAt | date: "dd.MM.yyyy"}}
</button>
But I don't know how to translate strings on component files combined with charts.js like:
@Input() examTakenList: Promise<Array<ExamTaken>>;
lineChartData: Array<any> = [
{ data: [], label: 'Richtige Antworten in %' }
];
lineChartLabels = new Array<string>();
lineChartOptions: any = {
animation: false,
responsive: true
};
I want to translate the label: 'Richtige Antworten in %'.
How can I use ng2-translate pipe in typescript and JavaScript files ?
Thanks in Advance