【发布时间】:2017-08-31 15:00:13
【问题描述】:
我使用 SmartTable ,在那张表中我有分页模板。 在表格的页脚中,我需要显示“X 的第 1 页”,所以我使用了 html 模板:
<tfoot>
<tr>
<td colspan="{{ct.headCells.length}}" class="text-center">
<div st-items-by-page="itemsPerPage"
st-pagination=""
st-template="/templates/pagination.custom.html">
</div>
</td>
</tr>
</tfoot>
在我的pagination.html 模板中我有
<li><page-select>{{currentPage}}</page-select> of {{numPages}}</li>
一切都好,currentPage 和 numPages 显示得很好。
现在,我需要将单词 of 翻译成法语,所以我添加了一个新变量 $scope.ofText = "de"... 并在 HTML 模板中使用它:
<li><page-select>{{currentPage}}</page-select> {{ofText}} {{numPages}}</li>
不显示任何文字而不是{{ofText}}...
如何在模板中添加自定义变量?
【问题讨论】:
-
在哪里可以解决您的问题?
-
我最终得到了
st-template="/templates/pagination.{{lang}}.html">...
标签: angularjs smart-table