在Angular中使用ngx-translate转换datatable.net

我正在使用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'
  }

  });
   });
lst0415 回答:在Angular中使用ngx-translate转换datatable.net

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3089671.html

大家都在问