karma-ng-directive-template-url-preprocessor
Preprocessor for loading html referenced dynamiclly on AngularJS directives.
Installation
The easiest way is to keep karma-ng-directive-template-url-preprocessor
as a devDependency in your package.json
.
You can simple do it by:
npm install karma-ng-directive-template-url-preprocessor --save-dev
Configuration
// karma.conf.jsmodule { config;};
How does it work ?
This preprocessor converts HTML URLs located on the URLs of Angular directives into JS strings and generates Angular modules. These modules, when loaded, insert these HTML files into the $templateCache
and therefore Angular won't try to fetch them from the server.
For instance this /templates/my_directive
...
something
... will be served as /templates/my_directive.js
:
angular;