在Angular中使用ngx translate转换datatable.net
我正在使用ngx翻译来翻译我的网络应用程序。我有来自的jquery表,当我单击flag更改语言时,我无法翻译此组件的标签 我可以用正确的语言初始化数据表,但我不能更改它。这是我的表初始化在Angular中使用ngx translate转换datatable.net,angular,datatables,ngx-translate,Angular,Datatables,Ngx Translate,我正在使用ngx翻译来翻译我的网络应用程序。我有来自的jquery表,当我单击flag更改语言时,我无法翻译此组件的标签 我可以用正确的语言初始化数据表,但我不能更改它。这是我的表初始化 this.http.get('https://5dcb25c534d54a0014314ce2.mockapi.io/api/closedbusiness') .subscribe((data: any[]) => { this.closedbusiness = data;
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'
}
});
});
当所选语言发生更改时,您具体会做什么?目前,我什么也不做,因为我搜索了选项,但没有找到任何相关内容。我尝试了这个解决方案(),但没有积极的结果。