隔离范围数据未显示在指令模板中

isolated scope data not displaying in directive template

我正在构建自定义 Angular 指令以在我的应用程序中显示分页。

我正在使用隔离范围来传递 totalNoOfRecords 但它没有显示。任何帮助将不胜感激

这是我到目前为止尝试过的代码

调用指令的模板:

<pagination totalData="111"></pagination>

Directive.js

function pagination() {
    return {
        restrict: 'EA',
        templateUrl: 'template/directives/pagination.html',
        scope: {
            totalData: '@',
        },
        link: dirPaginationControlsLinkFn
    };
}

指令模板

<span class="pagination-text">
   of {{totalData}} 
</span>

在 AngularJS 中,作用域绑定在 JS 中应为驼峰式,在 HTML 中应为 kebab 式。

您必须将 HTML 从

更改为
<pagination totalData="111"></pagination>

<pagination total-data="111"></pagination>