Skip to content

Commit

Permalink
Merge pull request #117 from shiquan-lim/master
Browse files Browse the repository at this point in the history
Re-implemented registered total
  • Loading branch information
scboesch committed Sep 27, 2016
2 parents 05f66c6 + e216898 commit a1706d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<md-button>Rank</md-button>
</th>
<th ng-if="!ctrl.showFilteredRanking">
<md-button>Registered ({{ctrl.cohortTotalParticipants}})</md-button>
<md-button>Registered ({{ctrl.cohortTotalParticipants.length}})</md-button>
</th>
<th ng-if="ctrl.showFilteredRanking">
<md-button>Qualified</md-button>
Expand Down
2 changes: 2 additions & 0 deletions src/classmentors/components/cohorts/cohorts.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ function ClmCohortRankPageCtrl($q, $scope, $log, firebaseApp, $firebaseObject, $
var db = firebaseApp.database();
var unwatchers = [];
this.cohortEventData = [];
this.cohortTotalParticipants = [];

// *************************** Re-write code here ***************************

Expand Down Expand Up @@ -922,6 +923,7 @@ function ClmCohortRankPageCtrl($q, $scope, $log, firebaseApp, $firebaseObject, $
participantsArray.$loaded().then(
() => (self.cohortEventData.find(e => e.id == eventId).participants = participantsArray)
).then(function () {
self.cohortTotalParticipants = self.cohortTotalParticipants.concat(participantsArray);
for(let participantIndex = 0; participantIndex < participantsArray.length; participantIndex++) {
// console.log("User " + participantsArray[participantIndex].$id + " from event " + eventId);
$firebaseObject(db.ref(`classMentors/userProfiles/${participantsArray[participantIndex].$id}/services`)).$loaded().then(function (result) {
Expand Down

0 comments on commit a1706d1

Please sign in to comment.