Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
QLNS_N01
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Văn Hiếu
QLNS_N01
Commits
2f868f5c
Commit
2f868f5c
authored
Jun 11, 2019
by
đinh thị đầm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new commit
parent
7c7e1d07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
17 deletions
+24
-17
src/main/resources/public/js/app.js
src/main/resources/public/js/app.js
+1
-1
src/main/resources/public/pages/employee/employee.html
src/main/resources/public/pages/employee/employee.html
+4
-4
src/main/resources/public/pages/employee/employeeController.js
...ain/resources/public/pages/employee/employeeController.js
+19
-12
No files found.
src/main/resources/public/js/app.js
View file @
2f868f5c
/**
/**
*
*
*/
*/
angular
.
module
(
"
myApp
"
,
[
'
ui.router
'
]).
config
(
function
(
$stateProvider
,
$urlRouterProvider
,
$locationProvider
)
{
angular
.
module
(
"
myApp
"
,
[
'
ui.router
'
,
'
ui.bootstrap
'
]).
config
(
function
(
$stateProvider
,
$urlRouterProvider
,
$locationProvider
)
{
$locationProvider
.
hashPrefix
(
''
);
$locationProvider
.
hashPrefix
(
''
);
$urlRouterProvider
.
otherwise
(
"
/employees
"
);
$urlRouterProvider
.
otherwise
(
"
/employees
"
);
...
...
src/main/resources/public/pages/employee/employee.html
View file @
2f868f5c
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<div
class=
"col-md-8"
>
<tr>
<td><a
class=
"btn btn-info"
href=
"#"
ui-sref=
"createEmployee"
>
Add
</a></td>
</tr>
<table
class=
"table"
>
<table
class=
"table"
>
<thead>
<thead>
...
@@ -48,9 +50,7 @@
...
@@ -48,9 +50,7 @@
<div
data-pagination=
""
data-num-pages=
"numOfPages()"
<div
data-pagination=
""
data-num-pages=
"numOfPages()"
data-current-page=
"curPage"
data-max-size=
"maxSize"
data-current-page=
"curPage"
data-max-size=
"maxSize"
data-boundary-links=
"true"
></div>
data-boundary-links=
"true"
></div>
<tr>
<td><a
class=
"btn btn-info"
href=
"#"
ui-sref=
"createEmployee"
>
Add
</a></td>
</tr>
</div>
</div>
...
...
src/main/resources/public/pages/employee/employeeController.js
View file @
2f868f5c
...
@@ -94,25 +94,32 @@ angular.module("myApp").controller("employeeController", function ($scope, $http
...
@@ -94,25 +94,32 @@ angular.module("myApp").controller("employeeController", function ($scope, $http
// $scope.reload();
// $scope.reload();
// $scope.curPage = 1,
// $scope.curPage = 1,
$scope
.
page
=
function
(
emp
)
{
$scope
.
curPage
=
1
,
$scope
.
empPerPage
=
3
,
$scope
.
maxSize
=
5
;
$scope
.
numOfPages
=
function
()
{
$scope
.
curPage
=
1
,
return
Math
.
ceil
(
emp
.
length
/
$scope
.
empPerPage
);
$scope
.
itemsPerPage
=
3
,
$scope
.
maxSize
=
5
;
}
;
this
.
emp
=
$scope
.
emp
;
$scope
.
$watch
(
'
curPage + numPerPage
'
,
function
()
{
var
begin
=
((
$scope
.
curPage
-
1
)
*
$scope
.
empPerPage
),
end
=
begin
+
$scope
.
empPerPage
;
$scope
.
employess
=
emp
.
slice
(
begin
,
end
);
$scope
.
numOfPages
=
function
()
{
});
return
Math
.
ceil
(
$scope
.
emp
.
length
/
$scope
.
itemsPerPage
);
};
};
$scope
.
$watch
(
'
curPage + numPerPage
'
,
function
()
{
var
begin
=
((
$scope
.
curPage
-
1
)
*
$scope
.
itemsPerPage
),
end
=
begin
+
$scope
.
itemsPerPage
;
$scope
.
employess
=
$scope
.
emp
.
slice
(
begin
,
end
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment