npm

Need private packages and team management tools?Check out npm Orgs. »

karma-ng-template-preprocessor

1.0.5 • Public • Published

karma-ng-template-script-to-template-cache-preprocessor

Preprocessor for taking HTML files that have <script type="ng/template"> and putting them into the Angularjs Template Cache Thanks to karma-ng-html2js-preprocessor for the idea and code snippets

Installation

$ npm install karma-ng-template-preprocessor --save-dev

Karma config

module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.html': ['ng-template'],
      '**/*.cshtml': ['ng-template']
    },
 
    files: [
      '**/*.html',
      '**/*.cshtml'
    ],
 
    // if you have defined plugins explicitly, add karma-ng-template-script-to-template-cache-preprocessor
    // plugins: ['karma-ng-template-preprocessor']
 
    ngTemplatePreprocessor: {
      //optional module name , templates by default
      //moduleName: 'specialTemplates'
    }
  })
}

Using it in your tests

  describe('example test', function(){
    beforeEach(module('templates'));    
  });

install

npm i karma-ng-template-preprocessor

Downloadsweekly downloads

2,056

version

1.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability