我正在使用ngx-translate来翻译我的Web应用程序。我有https://datatables.net/的jquery表,当我单击标志更改语言时,我无法翻译该组件的标签。
我可以使用正确的语言初始化数据表,但是不能更改它。这是我的表初始化。
this.http.get('https://5dcb25c534d54a0014314ce2.mockapi.io/api/closedbusiness')
.subscribe((data: any[]) => {
this.closedbusiness = data;
// You'll have to wait that changeDetection occurs and projects data into
// the HTML template, you can ask Angular to that for you ;-)
this.chRef.detectChanges();
this.dataTable = $('#tableid').DataTable({
dom: 'Blfrtip',
buttons: [
'excel', 'pdf', 'print'
],
language: {
url: '/assets/i18n/pt.json'
}
});
});