gaf-mobile
Version:
GAF mobile Web site
38 lines (33 loc) • 1.21 kB
JavaScript
module('gafMobileApp')
.directive('bidItem', function($window) {
return {
restrict: 'E',
templateUrl: 'components/bid-item/bid-item.html',
scope: {
bid: '=', // bid object
project: '=', // raw project object
expandable: '@', // is the card expandable?
expanded: '@', // is the card expanded?
title: '@', // bid item title, will be shown above the bid
abTests: '=', // Object for AB tests
},
transclude: true,
controllerAs: 'ctrl',
bindToController: true,
controller: function() {
var _this = this;
_this.bidderDetails = _this.bid.getBidderDetails().get();
_this.abTests = _this.abTests || {};
// Return dashed country name for icon classes
_this.countryName = function() {
if (angular.isDefined(_this.bidderDetails.location.country.name)) {
return _this.bidderDetails
.location.country.name.replace(/\s+/g, '-');
}
};
_this.linkToBidderProfile = '/u/' + _this.bidderDetails.username +
'?project=' + _this.project.seo_url + '&bid=' + _this.bid.get().id;
}
};
});
;
angular.