Sha256: aae08cf9e59025f654fe2675ab218be429faf6ca3dfe2534058edab1dae0bce8

Contents?: true

Size: 668 Bytes

Versions: 8

Compression:

Stored size: 668 Bytes

Contents

app.directive('rsRequestBody', function($compile, PayloadTemplates) {
  return {
    restrict: 'E',
    scope: {
      payload: '='
    },
    link: function(scope, element, attrs) {
      // 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

8 entries across 8 versions & 1 rubygems

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