使用/安装无节点的AngularJS智能表
我想在html代码中使用Angular smart table 我的环境: 服务器端-Apache vs java 客户端-带角度的html 我下载了smart table repository,但我很难手动安装该模块,而且在web上没有相关说明或教程 到目前为止,我尝试的是:使用/安装无节点的AngularJS智能表,angularjs,smart-table,Angularjs,Smart Table,我想在html代码中使用Angular smart table 我的环境: 服务器端-Apache vs java 客户端-带角度的html 我下载了smart table repository,但我很难手动安装该模块,而且在web上没有相关说明或教程 到目前为止,我尝试的是: 在我的html文件中,我指向smart-table.js和smart-table.min.js <script src="../app/assets/js/smart-table.js"></scrip
<script src="../app/assets/js/smart-table.js"></script>
<script src="../app/assets/js/smart-table.min.js"></script>
但它不起作用,智能表期货无法识别
请帮助正确配置此项
这是我的一般代码:
<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>
获取angularjs测试仪
农场名称
...
...
...
...
var app=angular.module('farmmanagement',['smart-table']);
app.controller('mainCtrl',函数($scope,$http){
$http.get(“”).then(函数(响应){
$scope.rowCollection=response.data.farms;
});
});
谢谢
Dima您从未定义
$scope.displayedCollection
。浏览器控制台中出现任何错误?而且您只需要一个版本的smart-table.js。不仅如此,关于$scope.displayedCollection没有任何错误,而且我在没有它的情况下尝试了相同的问题,库只是无法识别。还分别尝试了两个导入,但仍然无法识别您从未定义$scope.displayedCollection
。浏览器控制台中出现任何错误?而且您只需要一个版本的smart-table.js。不仅如此,关于$scope.displayedCollection没有任何错误,而且我在没有它的情况下尝试了相同的问题,库只是无法识别。还分别尝试了两种进口产品,但仍不被认可
<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>