Sha256: 3f91bcf8f40556f97216cc6cf8547f66ef998cd6cb30e86a050f9be437e8ee8f
Contents?: true
Size: 751 Bytes
Versions: 4
Compression:
Stored size: 751 Bytes
Contents
app.directive('rsAttributeTable', function() { return { restrict: 'E', templateUrl: 'views/directives/attribute_table.html', controller: function(){}, scope: { attributes: '=', showGroups: '=' }, link: function(scope) { // create attribute groups scope.groups = [{attributes: []}]; // handle required, optional if(scope.showGroups) { scope.groups[0].name = 'Required'; scope.groups.push({name: 'Optional', attributes: []}); } // map hash to array _(scope.attributes).forEach(function(attr, key) { attr.name = attr.name || key; scope.groups[(scope.showGroups && !attr.required ? 1 : 0)].attributes.push(attr); }); } }; });
Version data entries
4 entries across 4 versions & 1 rubygems