gaf-mobile
Version:
GAF mobile Web site
29 lines (26 loc) • 712 B
JavaScript
module('gafMobileApp')
.directive('dashboardItem', function() {
return {
restrict: 'E',
templateUrl: 'components/dashboard-item/dashboard-item.html',
scope: {
projects: '=', // projects object
hash: '@'
},
transclude: true,
controllerAs: 'ctrl',
bindToController: true,
controller: function() {
var _this = this;
_this.limit = 5;
_this.showAll = false;
_this.toggle = function() {
if(_this.projects.length > 5) {
_this.limit = _this.limit === 5 ? _this.projects.length : 5;
_this.showAll = !_this.showAll;
}
};
}
};
});
;
angular.