UNPKG

unserver-unify

Version:

30 lines (28 loc) 861 B
'use strict'; angular.module('bamboo.mystudy').controller('MyExamsCtrl', function($scope, ApiService, $state, $stateParams,loginService) { this.id = $scope.id = $stateParams.id; this.mvsubject = {}; var _self = this; this.completed=0; $scope.appUrl = ApiService.APPURL; $scope.subDomain = loginService.subDomain; function getInfo() { var examinfo = { action: 'getmyexams', } console.log(examinfo); ApiService.post('/lcourses', examinfo).then(function(result) { console.log("-------!!--------"); console.log(result.data.data); $scope.examitems=result.data.data || 0; var completed=0; angular.forEach($scope.examitems,function(item){ if(item.resultid){ completed++; } }) _self.completed=completed; }); }; getInfo(); });