Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. angular.module('carouselApp')
  2. .directive('waProgress', ['Pages', 'Carousel', '$window', '$timeout', function(Pages, Carousel, $window, $timeout) {
  3. return {
  4. scope: {
  5. pages: "="
  6. },
  7. templateUrl: 'views/wa.progress.html',
  8. transclude: true,
  9. require: '^waCarousel',
  10. link: function(scope, el, attrs, ctrl) {
  11. // console.log();
  12. scope.progressed = false;
  13. scope.$root.subscribe('updateCarousel', function(params){
  14. // console.log('asdfasdf', params);
  15. scope.progress = params;
  16.  
  17. scope.passedProgress = function(idx){
  18. if(scope.progress.currentPage > idx){
  19.  
  20. console.log(el.width());
  21. return scope.progressed = true;
  22. // scope.animatedWidth = $
  23.  
  24. }
  25. }
  26.  
  27.  
  28. });
  29.  
  30.  
  31.  
  32. scope.futureProgress = function(idx) {
  33. console.log(idx)
  34. };
  35. }
  36. }
  37.  
  38. }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement