【发布时间】:2020-10-24 19:49:05
【问题描述】:
如何在 Angular 中将 DataTable 的语言从英语更改为法语 这是我的代码
<table #mytable *ngIf="utilisateurs" datatable class="row-border hover">
<thead>
<tr>
<th>Nom</th>
<th>Prenom</th>
<th>Email</th>
<th>Preference</th>
<th>Pointe Vente</th>
<th>Type Utilisateur</th>
<th>Date Creation</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let u of utilisateurs">
<td>{{ u.nom }}</td>
<td>{{ u.prenom }}</td>
<td>{{ u.email }}</td>
<td>{{ u.preference }}</td>
<td>{{ u.nomPointeVente }}</td>
<td>{{ u.typeUtilisateur }}</td>
<td>{{ u.dateCreation }}</td>
<td><i title="editer" (click)="editer(u)" class="fas fa-user-edit" style="margin:10px; "
data-toggle="modal" data-target="#myModaledit"></i> <i title="supprimer" class="fas fa-user-times" style="margin:10px; "></i> <i title="details" class="fas fa-info-circle"style="margin:10px; "></i> </td>
</tr>
</tbody>
这是 JQuery Haw 中的更正,我可以用角度来做吗
<script type="text/javascript">
$(document).ready(function() {
$('#example').dataTable( {
"language": {
"url": "dataTables.german.lang"
}
} );
} );
【问题讨论】:
-
不确定您的意思-您能提供更多详细信息吗?一个例子?如果您指的是 Datatables 提供的标签(例如用于页面滚动等),那么您是否熟悉 Datatables internationalisation plug-ins? Here 是法语之一。
-
还可以查看主手册中的internationalisation 页面。尝试实施某些事情 - 如果您有具体问题,可以提出具体问题。
-
是如此简单,我在 Angular 中使用数据表,我想将语言更改为法语我如何在 Angular 中做到这一点''''
-
你的代码与 Angular 无关;它是 jQuery。
-
不是我的代码是 jQuery 中的示例我在 Angular 中搜索 un 示例
标签: datatables angular-ui-bootstrap