Sha256: 73d0c5abac45706e3b4204004ba9be327668ace0ba88c1f569a7ca0abcdf2a6d

Contents?: true

Size: 760 Bytes

Versions: 8

Compression:

Stored size: 760 Bytes

Contents

app.directive('rsAttributeTable', function() {
  return {
    restrict: 'E',
    templateUrl: 'views/directives/attribute_table.html',
    controller: function(){},
    scope: {
      attributes: '=',
      showGroups: '='
    },
    link: function(scope, element) {
      // 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

8 entries across 8 versions & 1 rubygems

Version Path
praxis-0.13.0 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.11.2 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.11.1 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.11 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.11pre lib/api_browser/app/js/directives/attribute_table.js
praxis-0.10.1 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.10.0 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.9 lib/api_browser/app/js/directives/attribute_table.js