智能表分页会引发错误

时间:2015-06-15 18:40:04

标签: smart-table

我的页面成功加载了智能表js,但是当我尝试使用分页功能时(如文档中所示),我收到以下错误

http://localhost:47544/template/smart-table/pagination.html Failed to load resource: the server responded with a status of 404 (Not Found)

Error: [$compile:tpload] http://errors.angularjs.org/1.3.7/$compile/tpload?p0=template%2Fsmart-table%2Fpagination.html

我不确定我做错了什么,但下面是我的代码。任何帮助都会很棒!谢谢!

<body>
<div ng-controller="testController as ctrl">
    <div>
        <div class="page-header"><h2>Table Test</h2></div>
        <div class="row">
            <div class="col-xs-12 col-sm-8 col-lg-6">
                <table st-table="ctrl.myData" class="table table-striped">
                    <thead>
                        <tr>
                            <th colspan="10"><input st-search="" placeholder="Universal Search" class="input-sm form-control" type="search"/></th>
                        </tr>
                        <tr>
                            <th st-sort="name">name</th>
                            <th st-sort="location">location</th>
                            <th st-sort="age">age</th>
                            <th st-sort="phone">phone</th>
                        </tr>
                        <tr>
                            <th><input st-search="name" placeholder="Search" class="input-sm form-control" type="search" /></th>
                            <th><input st-search="location" placeholder="Search" class="input-sm form-control" type="search" /></th>
                            <th><input st-search="age" placeholder="Search" class="input-sm form-control" type="search" /></th>
                            <th><input st-search="phone" placeholder="Search" class="input-sm form-control" type="search" /></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in ctrl.myData">
                            <td>{{row.name}}</td>
                            <td>{{row.location}}</td>
                            <td>{{row.age}}</td>
                            <td>{{row.phone}}</td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="4" class="text-center">
                                <div st-pagination="" st-items-by-page="5" st-displayed-pages="3"></div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
            <div class="clearfix visible-xs-block"></div>
            <div class="col-xs-0 col-sm-2 col-lg-3"></div>
        </div>
    </div>
</div>
</body> 

1 个答案:

答案 0 :(得分:0)

现在为时已晚,但是如果有人面临同样的问题,你可以检查一下,你可能只是在某处调用了下一个方法之一,并通过缓存中的这个已删除的默认分页模板。

$templateCache.destroy(); 
$templateCache.removeAll();
$templateCache.remove('template/smart-table/pagination.html');

Check this documentation for info about methods