{ "name": "karma-ng-html2js-preprocessor", "version": "0.1.0", "description": "A Karma plugin. Compile AngularJS templates to JavaScript on the fly.", "main": "lib/index.js", "scripts": { "test": "grunt test" }, "repository": { "type": "git", "url": "git://github.com/karma-runner/karma-ng-html2js-preprocessor.git" }, "keywords": [ "karma-plugin", "karma-preprocessor", "angularjs", "angular", "html2js" ], "author": { "name": "Vojta Jina", "email": "vojta.jina@gmail.com" }, "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", "grunt-simple-mocha": "~0.4", "grunt-contrib-jshint": "~0.6", "chai": "~1.4", "mocha": "~1.8", "grunt-npm": "~0.0.2", "grunt-bump": "~0.0.7", "grunt-auto-release": "~0.0.2" }, "peerDependencies": { "karma": ">=0.9" }, "license": "MIT", "contributors": [ { "name": "Friedel Ziegelmayer", "email": "friedel.ziegelmayer@gmail.com" }, { "name": "Lukasz Bandzarewicz", "email": "lucassus@gmail.com" }, { "name": "Robin Roestenburg", "email": "robin@roestenburg.io" }, { "name": "Lucas Galfasó", "email": "lgalfaso@gmail.com" }, { "name": "Friedel Ziegelmayer", "email": "dignifiedquire@gmail.com" }, { "name": "BrianLenzo", "email": "brian.lenzo@gmail.com" } ], "readme": "# karma-ng-html2js-preprocessor [![Build Status](https://travis-ci.org/karma-runner/karma-ng-html2js-preprocessor.png?branch=master)](https://travis-ci.org/karma-runner/karma-ng-html2js-preprocessor)\n\n> Preprocessor for converting HTML files to [AngularJS](http://angularjs.org/) templates.\n\n*Note:* If you are looking for a general preprocessor that is not tight to Angular, check out [karma-html2js-preprocessor](https://github.com/karma-runner/karma-html2js-preprocessor).\n\n## Installation\n\nThe easiest way is to keep `karma-ng-html2js-preprocessor` as a devDependency in your `package.json`.\n```json\n{\n \"devDependencies\": {\n \"karma\": \"~0.10\",\n \"karma-ng-html2js-preprocessor\": \"~0.1\"\n }\n}\n```\n\nYou can simple do it by:\n```bash\nnpm install karma-ng-html2js-preprocessor --save-dev\n```\n\n## Configuration\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n config.set({\n preprocessors: {\n '**/*.html': ['ng-html2js']\n },\n\n files: [\n '*.js',\n '*.html'\n ],\n\n ngHtml2JsPreprocessor: {\n // strip this from the file path\n stripPrefix: 'public/',\n // prepend this to the\n prependPrefix: 'served/',\n\n // or define a custom transform function\n cacheIdFromPath: function(filepath) {\n return cacheId;\n },\n\n // setting this option will create only a single module that contains templates\n // from all the files, so you can load them all with module('foo')\n moduleName: 'foo'\n }\n });\n};\n```\n\n## How does it work ?\n\nThis preprocessor converts HTML files into JS strings and generates Angular modules. These modules, when loaded, puts these HTML files into the `$templateCache` and therefore Angular won't try to fetch them from the server.\n\nFor instance this `template.html`...\n```html\n