Sha256: d9698990a98b8f39db408d14769ada4bba4f4e15d3e2821b9606cd9f027fb2b5

Contents?: true

Size: 493 Bytes

Versions: 14

Compression:

Stored size: 493 Bytes

Contents

app.factory('prepareTemplate', function($q, $http, $templateCache, $compile) {
  return function(result) {
    return $q.when(result).then(function(template) {
      if (_.isFunction(template)) {
        return template;
      } else if (_.isString(template)) {
        return $http.get(template, {cache: $templateCache}).then(function(response) {
          return $compile(response.data);
        });
      } else {
        throw 'Resolver returned an unknown type';
      }
    });
  };
});

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
praxis-2.0.pre.9 lib/api_browser/app/js/factories/prepare_template.js
praxis-2.0.pre.8 lib/api_browser/app/js/factories/prepare_template.js
praxis-2.0.pre.7 lib/api_browser/app/js/factories/prepare_template.js
praxis-2.0.pre.6 lib/api_browser/app/js/factories/prepare_template.js
praxis-2.0.pre.5 lib/api_browser/app/js/factories/prepare_template.js
praxis-2.0.pre.4 lib/api_browser/app/js/factories/prepare_template.js
praxis-2.0.pre.3 lib/api_browser/app/js/factories/prepare_template.js
praxis-2.0.pre.2 lib/api_browser/app/js/factories/prepare_template.js
praxis-2.0.pre.1 lib/api_browser/app/js/factories/prepare_template.js
praxis-0.22.pre.2 lib/api_browser/app/js/factories/prepare_template.js
praxis-0.22.pre.1 lib/api_browser/app/js/factories/prepare_template.js
praxis-0.21 lib/api_browser/app/js/factories/prepare_template.js
praxis-0.20.1 lib/api_browser/app/js/factories/prepare_template.js
praxis-0.20.0 lib/api_browser/app/js/factories/prepare_template.js