UNPKG

unserver-unify

Version:

36 lines (34 loc) 1.28 kB
'use strict'; angular.module('bamboo.mystudy').controller('CERTController', function(loginService, $cookieStore, $rootScope, $stateParams, ApiService, CertService, $timeout, userBizModel, $q, certBizModel,siteConfigSvs,CertificateModel) { var self = this; this.id = ApiService.gid; console.log(loginService); this.school = loginService.school; this.user = loginService.user; console.log(loginService.user); this.schoolIconUrl = ApiService.PSURL + "/school/" + self.id + "/"; console.log($stateParams); //this.cid = $stateParams.cid; this.certid = $stateParams.certid; var config = { ElementId: "canvas", paddingtop: 150, schoolname: self.school.name, schoolIconUrl: self.schoolIconUrl, courseId: $stateParams.courseid, certId: self.certid, //orientation:self.school.certOrientation, lang:$rootScope.currentLanguage }; this.DownloadCertificate = function() { var conf = { courseId: $stateParams.courseid }; certBizModel.downloadCERT('certificate.pdf','canvas',conf); }; var model = CertificateModel.createCertModel(config).getCertTemplate().then(function(data){ console.log(data); certBizModel.renderCERT(data); }); console.log(model.certInfo); });