Sha256: 510b5c117d14a189323c1d526ccef447f32437d68a7050cb4355595744b3ec31
Contents?: true
Size: 1.06 KB
Versions: 13
Compression:
Stored size: 1.06 KB
Contents
app.directive('requestExamples', function(Examples, $timeout) { return { restrict: 'E', scope: { action: '=', resource: '=', version: '=' }, template: '<tabset><tab ng-repeat="example in examples" heading="{{example.displayName}}" select="select(example.template)"></tab></tabset>', link: function(scope, element) { scope.examples = Examples.forContext(scope.action, scope.version, scope.resource); var keys = _.keys(scope.examples); if (keys.length === 1) { scope.examples[keys[0]].template.then(function(templateFn) { $timeout(function() { element.empty().append(templateFn(scope)); }, 100); }); } else { scope.select = function(template) { template.then(function(templateFn) { $timeout(function() { element.find('.tab-content:eq(0)>.tab-pane.active:not(.initialized)').append(templateFn(scope)).addClass('initialized'); template.then = _.noop; }, 100); }); }; } } }; });
Version data entries
13 entries across 13 versions & 1 rubygems