Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.EventListCtrl = ($scope, Event, User, Tournament) ->
- $scope.participants = {}
- total = 0
- $scope.events = Event.list {}, () ->
- for listEvent, i in $scope.events
- Event.grab {event_id: listEvent._id}, (_event) ->
- $scope.participants[_event._id] = 0
- for tourney_id in _event.tournaments
- Tournament.grab {tournament_id: tourney_id}, (_tourney) ->
- $scope.participants[_event._id] += _tourney.participants.length
Add Comment
Please, Sign In to add comment