Guest User

Untitled

a guest
Sep 22nd, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.EventListCtrl = ($scope, Event, User, Tournament) ->
  2.     $scope.participants = {}
  3.     total = 0
  4.    
  5.     $scope.events = Event.list {}, () ->
  6.         for listEvent, i in $scope.events
  7.             Event.grab {event_id: listEvent._id}, (_event) ->
  8.         $scope.participants[_event._id] = 0
  9.                 for tourney_id in _event.tournaments
  10.                     Tournament.grab {tournament_id: tourney_id}, (_tourney) ->
  11.                         $scope.participants[_event._id] += _tourney.participants.length
Add Comment
Please, Sign In to add comment