Skip to content

Instantly share code, notes, and snippets.

@DavidFrahm
Last active December 9, 2015 21:25
Show Gist options
  • Save DavidFrahm/3f3c76c964d0252df62d to your computer and use it in GitHub Desktop.
Save DavidFrahm/3f3c76c964d0252df62d to your computer and use it in GitHub Desktop.
Setup karma-ng-html2js-preprocessor
$ npm install --save-dev karma-ng-html2js-preprocessor
// Working example from Ionic app
module.exports = function (config) {
config.set({
basePath: './www',
files: [
// ...existing src...
'**/*.html',
// ...existing tests...
],
plugins: [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-ng-html2js-preprocessor'
],
preprocessors: {
'**/*.html': ['ng-html2js']
},
ngHtml2JsPreprocessor: {
moduleName: 'ngViews',
stripPrefix: 'www/'
},
reporters: ['progress']
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment