unserver-unify
Version:
55 lines (53 loc) • 1.54 kB
JavaScript
;
angular.module('bamboo').directive('courseTableList',function() {
return {
restrict: 'AE',
replace:true,
templateUrl: function(tElem, tAttrs){
var type = tAttrs.type || 'course';
switch(type){
case 'course':
return "app/directive/coursetablelist.directive.html";
break;
case 'coursembl':
return "app/directive/coursetablelistmbl.directive.html";
break;
case 'product':
return "app/directive/producttablelist.directive.html";
break;
case 'news':
return "app/directive/newstablelist.directive.html";
break;
case 'newsmbl':
return "app/directive/newstablelistmbl.directive.html";
break;
case 'teacher':
return "app/directive/teachertablelist.directive.html";
break;
case 'announcement':
return "app/directive/annotablelist.directive.html";
break;
case 'jobs':
return "app/directive/jobtablelist.directive.html";
break;
default:
return "app/directive/coursetablelist.directive.html";
}
},
scope:{
src:"=",
type:"@",
defaultimage:"@"
},
link: function(scope, element, attrs) {
console.log(scope);
},
controller:function(ApiService, loginService){
var self = this;
this.subDomain = loginService.subDomain;
this.newsPhotoUrl = ApiService.SHOST + "/companynews/";
this.jobsPhotoUrl = ApiService.SHOST + "/job/";
},
controllerAs: 'ctrl',
}
});