UNPKG

unserver-unify

Version:

22 lines 846 B
'use strict'; angular.module('bamboo.company').controller('DepartmentDetailCtrl', function( $location, ApiService,$state, $stateParams) { var _self = this; console.log("---- DepartmentDetailCtrl -----"); this.did = $stateParams.did; this.defaultPhoto = "assets/images/company.png"; this.schoolurl = ApiService.SHOST + "/public/" + ApiService.RES + "/school/" + ApiService.gid + "/"; this.hosturl = $location.host(); console.log(this.did); ApiService.get("/department/" + this.did).then(function(result) { console.log(result); if (result.data.success) { console.log(result.data.data); _self.item = result.data.data; if (_self.item.photo) { _self.imageUrl = _self.schoolurl + _self.item.photo; } else { _self.imageUrl = _self.defaultPhoto; } } }); });