在没有nodejs

时间:2016-10-09 13:26:50

标签: angularjs smart-table

我想在我的html代码中使用Angular智能表。

我的环境:

服务器端 - Apache vs java

客户端 - 带角度的html

我下载了智能表存储库,但我手动安装模块很困难,网上没有相关说明或教程

到目前为止我尝试的是:

  1. 在我的html文件中,我指向smart-table.js和smart-table.min.js

    <script src="../app/assets/js/smart-table.js"></script>
    <script src="../app/assets/js/smart-table.min.js"></script>
    
  2. 2.在我的应用中,我正在引用&#39; smart-table&#39;:

    var app = angular.module('FarmManagment', ['smart-table']);
    

    但它不能正常工作智能表未来不被认可。

    请帮助正确配置!!!

    这是我的一般代码:

    <html>
    <head>
        <title>get farms angularjs tester</title>
        <meta charset="UTF-8">
    
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    
        <link rel="stylesheet" href="../js/style.css">
        <link rel="stylesheet" href="../js/normalize.css">
        <link rel="stylesheet" href="../app/assets/css/search box">
        <link rel="stylesheet" href="../js/bootstrap.min.css">
    
    
    
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
    
        <script src="../app/assets/js/smart-table.js"></script>
        <script src="../app/assets/js/smart-table.min.js"></script>
    
    
    </head>
    <body ng-app="FarmManagment" ng-controller="mainCtrl">
    
    
    
    
    
    
        <!-- Data table -->
        <table id="auditTable" class="table table-hover" st-table="displayedCollection" st-safe-src="rowCollection" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th st-sort="FarmName">Farm Name</th>
                    ...
                    ...
                </tr>
            </thead>
            <tbody id ="tbody">
                <tr ng-repeat="row in rowCollection">
                    <td ng-bind="row.FarmName"></td>
                    ...
                    ...
                </tr>
    
            </tbody>
        </table>
    
        <script>
            var app = angular.module('FarmManagment', ['smart-table']);
            app.controller('mainCtrl', function ($scope,$http) {
                $http.get('<path>').then(function(response) {
                    $scope.rowCollection = response.data.farms;
                });
            });
        </script>
    </body>
    

    由于 迪马

0 个答案:

没有答案