|
|
|
@ -1,4 +1,5 @@ |
|
|
|
import masonry from '../masonry'; |
|
|
|
import Avatar from 'avatar-initials'; |
|
|
|
/** @ngInject */ |
|
|
|
const CompaniesController = ($scope, CompaniesService, UserService) => { |
|
|
|
$scope.$on('loadUserSuccess', async (event, user) => { |
|
|
|
@ -6,6 +7,14 @@ const CompaniesController = ($scope, CompaniesService, UserService) => { |
|
|
|
await CompaniesService.fetchCompaniesService() |
|
|
|
.then( (result) => { |
|
|
|
$scope.companies = result; |
|
|
|
|
|
|
|
$scope.avatar = function(index) { |
|
|
|
new Avatar(document.getElementById('company'+index), { |
|
|
|
'useGravatar': false, |
|
|
|
'initials': result[index].name[0], |
|
|
|
'initial_weight': 300, |
|
|
|
}); |
|
|
|
} |
|
|
|
masonry(); |
|
|
|
}) |
|
|
|
.catch( (error) => { console.log(error); }) |
|
|
|
|