Sha256: 8f9705e6f840aa9c98f642ca0c6f05176a7da6eafcbb5208e3cbd48c71c9ec1b
Contents?: true
Size: 708 Bytes
Versions: 8
Compression:
Stored size: 708 Bytes
Contents
/** * This directive is responsible for showing attributes in a table structure. */ app.directive('attributeTable', function() { return { restrict: 'E', templateUrl: 'views/directives/attribute_table.html', scope: { attributes: '=', showGroups: '=' }, link: function(scope) { scope.groups = [{attributes: []}]; if(scope.showGroups) { scope.groups[0].name = 'Required'; scope.groups.push({name: 'Optional', attributes: []}); } _.forEach(scope.attributes, function(attr, key) { attr.name = attr.name || key; scope.groups[(scope.showGroups && !attr.required ? 1 : 0)].attributes.push(attr); }); } }; });
Version data entries
8 entries across 8 versions & 1 rubygems