I cannot get the karma-ng-html2js preprocessor to work for an external template.
Json file package:
..... "gulp-karma": "*", "karma-coverage": "*", "karma-jasmine": "*", "karma-ng-html2js-preprocessor": "*", "karma-phantomjs-launcher": "*", .....
Karma configuration file:
config.set({ browsers: [ .... ], frameworks: [ 'jasmine' ], plugins: [ 'karma-jasmine', 'karma-phantomjs-launcher', 'karma-ng-html2js-preprocessor' ], preprocessors: { 'app/**/*.html': 'ng-html2js' }, ngHtml2JsPreprocessor: { stripPrefix: 'app/' } });
Files are defined in the build file and transferred to gulp -karma. Here are the specific files:
config = { test: { configFile: '.../karma.conf.js', depends: [ ....... ], files: [ "app/**/*.js", 'app/**/*.html' ] } }
Loading the template in my directive specification as shown below:
beforeEach(module('app')); beforeEach(module('app/tem/mytemp.html'));
I get an error message below:
Error: [$injector:modulerr] Failed to instantiate module app/tem/mytemp.html due to: Error: [$injector:nomod] Module 'app/tem/mytemp.html' is not available! You either misspelled the
In karma, the debug.html html files are loaded into the link tag output:
<script type="text/javascript" src="/absoluteC:.../app/tem/comp/mydirective.js"></script> <link href="/absoluteC:..../app/tem/mytemp.html" rel="import"> <script type="text/javascript"> window.__karma__.loaded();
Did I miss something? How to debug and promote this problem?