Skip to content

Commit

Permalink
#29 - estruturando pagination como diretiva
Browse files Browse the repository at this point in the history
  • Loading branch information
teles committed Mar 11, 2016
1 parent 4c1b24a commit 1bc57d6
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@
<navigation-header></navigation-header>
<alerts></alerts>
<main ui-view></main>
<div class="pagination">
<ul class="pagination__list">
<li class="pagination__list__item"><a href="" class="pagination__list__link">&lt; Anterior</a></li>
<li class="pagination__list__item"><a href="" class="pagination__list__link">1</a></li>
<li class="pagination__list__item"><a href="" class="pagination__list__link">2</a></li>
<li class="pagination__list__item"><a href="" class="pagination__list__link">3</a></li>
<li class="pagination__list__item"><a href="" class="pagination__list__link">Próxima &gt;</a></li>
</ul>
</div>
<pagination></pagination>
<page-footer></page-footer>
</body>
<!-- inject:js -->
Expand Down
16 changes: 16 additions & 0 deletions src/js/components/pagination/directives/pagination.directive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(function(){
'use strict';

angular.module('guest-post.pagination').directive('pagination', paginationDirective);

function paginationDirective(){
var directive = {
restrict: 'E',
templateUrl: '/js/components/pagination/templates/pagination.template.html',
scope: {},
replace: true
};
return directive;
}

})();
4 changes: 4 additions & 0 deletions src/js/components/pagination/pagination.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(function(){
angular.module('guest-post.pagination', []);
GUEST.angularDependencies.push('guest-post.pagination');
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="pagination">
<ul class="pagination__list">
<li class="pagination__list__item"><a href="" class="pagination__list__link">&lt; Anterior</a></li>
<li class="pagination__list__item"><a href="" class="pagination__list__link">1</a></li>
<li class="pagination__list__item"><a href="" class="pagination__list__link">2</a></li>
<li class="pagination__list__item"><a href="" class="pagination__list__link">3</a></li>
<li class="pagination__list__item"><a href="" class="pagination__list__link">Próxima &gt;</a></li>
</ul>
</div>
2 changes: 1 addition & 1 deletion src/styl/module/pagination.styl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
list-style: none
text-align: center
margin: 0
padding: get-spacing(1) 0
padding: get-spacing(2) 0
border-top: 1px solid rgb(233, 233, 233)
border-bottom: 1px solid rgb(233, 233, 233)

Expand Down

0 comments on commit 1bc57d6

Please sign in to comment.