/public/javascripts
我在我的节点项目的目录中有以下角度代码:
var app = angular.module('userContent', ['angularUtils.directives.dirPagination']);
app.controller('MainCtrl', [
'$scope',
function($scope){
$scope.users = []
$scope.addUser = function(){
if(!$scope.user || $scope.user === '') { return; }
$scope.users.push({
user: $scope.user,
vertrag: $scope.vertrag,
});
$scope.user = '';
$scope.vertrag = '';
};
}
]);
这是我的 html 模板,/views
位于我的节点项目的目录中
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.10/angular-ui-router.js"></script>
<script src="/javascripts/app.js"></script>
</head>
<body ng-app="userContent" ng-controller="MainCtrl">
<input ng-model="search">
<table border="1">
<th>user</th>
<th>vertrag</th>
<tr dir-paginate="u in users | filter:search | itemsPerPage: 4">
<td>{{ u.user }}</td>
<td>{{ u.vertrag }}</td>
</tr>
</table>
<dir-pagination-controls></dir-pagination-controls>
<form ng-submit="addUser()">
<input type="text"
placeholder="Benutzer"
ng-model="user">
</input> <br>
<input type="text"
placeholder="Vertrag"
ng-model="vertrag">
</input> <br>
<button type="submit">Submit</button>
</form>
</body>
</html>
我用凉亭安装了以下插件,我想使用它。但我总是得到这个错误:
Error: [$injector:modulerr]
我的文件的路径:
/home/ubuntu/project/views/index.ejs
/home/ubuntu/project/public/javascripts/app.js
/home/ubuntu/project/bower_components/angular-utils-pagination
/home/ubuntu/project/bower_components/angular-utils-pagination/dirPagination.js
/home/ubuntu/project/bower_components/angular-utils-pagination/dirPagination.tpl.html
/home/ubuntu/project/bower_components/angular-utils-pagination/bower.json