unserver-unify
Version:
30 lines (29 loc) • 871 B
JavaScript
;
angular.module('bamboo').controller('BBSSidebarCtrl', function($scope, TopicApi,CommonService) {
$scope.type = 'topics';
TopicApi.BBSApi({
action: 'gettopbbss'
}, function(data) {
$scope.hottopics = data.data;
angular.forEach($scope.hottopics,function(item){
var user={
id:item.author_id,
avatar:item.avatar_url,
}
item.photourl= CommonService.getAvatarSrc(user);
} )
console.log($scope.hottopics);
})
TopicApi.BBSApi({
action: 'getnewbbs'
}, function(data) {
$scope.newtopics = data.data;
angular.forEach($scope.newtopics,function(item){
var user={
id:item.author_id,
avatar:item.avatar_url,
}
item.photourl= CommonService.getAvatarSrc(user);
} )
})
});