Commit 7c7e1d07 authored by đinh thị đầm's avatar đinh thị đầm

new commit

parent 51db7d95
...@@ -2,7 +2,9 @@ package com.itsol.quantrivanphong; ...@@ -2,7 +2,9 @@ package com.itsol.quantrivanphong;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.web.filter.ShallowEtagHeaderFilter;
@SpringBootApplication @SpringBootApplication
@EnableJpaAuditing @EnableJpaAuditing
...@@ -11,5 +13,9 @@ public class QuantrivanphongApplication { ...@@ -11,5 +13,9 @@ public class QuantrivanphongApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(QuantrivanphongApplication.class, args); SpringApplication.run(QuantrivanphongApplication.class, args);
} }
@Bean
public ShallowEtagHeaderFilter shallowEtagHeaderFilter() {
return new ShallowEtagHeaderFilter();
}
} }
...@@ -26,4 +26,6 @@ public interface EmployeeBusiness extends Validator { ...@@ -26,4 +26,6 @@ public interface EmployeeBusiness extends Validator {
boolean confirmEmployee(Employee employee); boolean confirmEmployee(Employee employee);
public Page<Employee> findAll(Pageable pageable); public Page<Employee> findAll(Pageable pageable);
} }
...@@ -51,8 +51,9 @@ SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, Sony ...@@ -51,8 +51,9 @@ SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, Sony
<script src="js/app.js"></script> <script src="js/app.js"></script>
<script src="pages/employee/employeeController.js"></script> <script src="pages/employee/employeeController.js"></script>
<script src="pages/employee/createEmployeeController.js"></script> <script src="pages/employee/createEmployeeController.js"></script>
<script src="js/ui-bootstrap-tpls-0.3.0.min.js"></script>
<script src="js/dirPagination.js"></script> <script src="js/dirPagination.js"></script>
<script src="js/ui-bootstrap-tpls-0.3.0.min.js"></script>
<!-- end anguarjs app--> <!-- end anguarjs app-->
<link href="css/custom.css" rel="stylesheet"> <link href="css/custom.css" rel="stylesheet">
<!--//Metis Menu --> <!--//Metis Menu -->
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
</tbody> </tbody>
</table> </table>
<div data-pagination="" data-num-pages="numOfPages()"
data-current-page="curPage" data-max-size="maxSize"
data-boundary-links="true"></div>
<tr> <tr>
<td><a class="btn btn-info" href="#" ui-sref="createEmployee">Add</a></td> <td><a class="btn btn-info" href="#" ui-sref="createEmployee">Add</a></td>
</tr> </tr>
......
/** /**
* *
*/ */
angular.module("myApp").controller("employeeController", function($scope, $http, $state) { angular.module("myApp").controller("employeeController", function ($scope, $http, $state) {
console.log("Employee controller"); console.log("Employee controller");
$scope.emp = { $scope.emp = {
...@@ -40,17 +40,7 @@ angular.module("myApp").controller("employeeController", function($scope, $http, ...@@ -40,17 +40,7 @@ angular.module("myApp").controller("employeeController", function($scope, $http,
function updateEmp(emp) { function updateEmp(emp) {
console.log('edit'); console.log('edit');
$state.go('createEmployee', {emp: emp}); $state.go('createEmployee', {emp: emp});
// $scope.emp = emp;
// $http({
// method: 'PUT',
// url: "/employee/" + emp.id,
// data: $scope.emp
// }).then(function successCallback(response) {
// console.log(response);
//
// }, function errorCallback(response) {
// console.log(response)
// });
} }
// HTTP DELETE- delete employee by Id // HTTP DELETE- delete employee by Id
...@@ -102,7 +92,27 @@ angular.module("myApp").controller("employeeController", function($scope, $http, ...@@ -102,7 +92,27 @@ angular.module("myApp").controller("employeeController", function($scope, $http,
// },3) // },3)
// }; // };
// $scope.reload(); // $scope.reload();
// $scope.curPage = 1,
$scope.page = function (emp) {
$scope.curPage = 1,
$scope.empPerPage = 3,
$scope.maxSize = 5;
$scope.numOfPages = function () {
return Math.ceil(emp.length / $scope.empPerPage);
};
$scope.$watch('curPage + numPerPage', function () {
var begin = (($scope.curPage - 1) * $scope.empPerPage),
end = begin + $scope.empPerPage;
$scope.employess = emp.slice(begin, end);
});
};
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment