Sha256: 5cdd77c6482c44bfddc247e3b5e4775abd7942348c80824e722eab08b1260331
Contents?: true
Size: 739 Bytes
Versions: 11
Compression:
Stored size: 739 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: '=', parentRequirements: '=' }, 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
11 entries across 11 versions & 1 rubygems