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

Version Path
praxis-0.21 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.20.1 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.20.0 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.19.0 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.18.1 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.18.0 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.17.1 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.17.0 lib/api_browser/app/js/directives/attribute_table.js