Sha256: 1a420ac92e6827f43f7851a0c4f5bc52996f17bcbbf7413609e57801c9e77bd9

Contents?: true

Size: 664 Bytes

Versions: 4

Compression:

Stored size: 664 Bytes

Contents

app.directive('rsRequestBody', function($compile, PayloadTemplates) {
  return {
    restrict: 'E',
    scope: {
      payload: '='
    },
    link: function(scope, element) {
      // use the attribute type name to find the template
      var alt, name = (scope.payload.type ? scope.payload.type.name : null) || 'default';

      if(scope.payload.type) {
        scope.attributes = scope.payload.type.attributes;
      }

      if(name === 'Struct') {
        name = 'PraxisBody';
        alt = 'Struct';
      }

      PayloadTemplates.resolve(name, alt).then(function(template) {
        element.replaceWith($compile(template)(scope));
      });
    }
  };
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
praxis-0.16.1 lib/api_browser/app/js/directives/request_body.js
praxis-0.16.0 lib/api_browser/app/js/directives/request_body.js
praxis-0.15.0 lib/api_browser/app/js/directives/request_body.js
praxis-0.14.0 lib/api_browser/app/js/directives/request_body.js