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

Version Path
praxis-2.0.pre.9 lib/api_browser/app/js/directives/attribute_table.js
praxis-2.0.pre.8 lib/api_browser/app/js/directives/attribute_table.js
praxis-2.0.pre.7 lib/api_browser/app/js/directives/attribute_table.js
praxis-2.0.pre.6 lib/api_browser/app/js/directives/attribute_table.js
praxis-2.0.pre.5 lib/api_browser/app/js/directives/attribute_table.js
praxis-2.0.pre.4 lib/api_browser/app/js/directives/attribute_table.js
praxis-2.0.pre.3 lib/api_browser/app/js/directives/attribute_table.js
praxis-2.0.pre.2 lib/api_browser/app/js/directives/attribute_table.js
praxis-2.0.pre.1 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.22.pre.2 lib/api_browser/app/js/directives/attribute_table.js
praxis-0.22.pre.1 lib/api_browser/app/js/directives/attribute_table.js