UNPKG

unserver-unify

Version:

25 lines 749 B
'use strict'; angular.module('bamboo.course').controller('MyAssignmentsCtrl', function($scope, ApiService) { this.mvsubject = {}; var _self = this; this.completed=0; function getInfo() { var examinfo = { action: 'getmyassignments', } console.log(examinfo); ApiService.post('/lcourses', examinfo).then(function(result) { console.log(result.data.data); $scope.assignmentitems=result.data.data || 0; var completed=0; angular.forEach($scope.assignmentitems,function(item){ if(item.commentscounter){ completed++; } }) _self.completed=completed; _self.uncomplete=$scope.assignmentitems.length-completed; }); }; getInfo(); });