Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. In de "backlogs" en "tags" poller de functie aanroepen ( $scope.tagsPbiCount(); )
  2. Functie in MainCtrl plakken
  3.  
  4. $scope.tagsPbiCount = function(){
  5. //Laurens show pbis script
  6. if($rootScope.backlogitems && $rootScope.backlogitems.length > 0 && $rootScope.tags){
  7. for(var x in $rootScope.tags){
  8. var count = 0;
  9. var tag = $rootScope.tags[x];
  10.  
  11. for(var i=0; i < $rootScope.backlogitems.length; i++){
  12. var pbi = $rootScope.backlogitems[i];
  13.  
  14. if(pbi.tag){ // if pbi has tags, loop through tags of pbi
  15. for(var z=0; z < pbi.tag.length; z++){
  16. var pbiTag = pbi.tag[z];
  17.  
  18. if(pbiTag.name == tag.name){ // if name of pbi tag == name of current then count++
  19. count++;
  20. }
  21. }
  22. }
  23. }
  24. tag.amountPbis = count; // assign count to tag
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement