ng-html2js

Directive with templateUrl - testing with ng-html2js

陌路散爱 提交于 2020-01-13 10:36:10
问题 I created a directive with inline template, tested it, everything worked fine. Now I have put the template into separated .html file and reference it via templateUrl from directive. Directive works on my page, but the tests are broken saying: Error: [$injector:modulerr] Failed to instantiate module source/html/par tials/template-directive-my-directive.html due to: Error: [$injector:nomod] Module 'source/html/partials/template-directive -my-directive.html' is not available! You either

karma – angular unittesting directive with a templateUrl fails, even with ng-html2js with “unexpected request”

落爺英雄遲暮 提交于 2019-12-09 20:55:41
问题 Now I'm getting: INFO [karma]: Karma v0.10.2 server started at `http://localhost:9876/` INFO [launcher]: Starting browser Chrome INFO [Chrome 30.0.1599(Linux)]: Connected on socket Q8d9RLBQDqi7wJ8iaKNw Chrome 30.0.1599 (Linux) directives Mydirective directive should render Roi element correctly FAILED Error: Unexpected request: GET partials/directives/Mydirective.html No more request expected at Error (<anonymous>) at $httpBackend (/home/user/Documents/Projects/angularproject/test/lib/angular

setting up ng-htmljs-preprocessor karma preprocessor

允我心安 提交于 2019-12-06 01:33:08
问题 I am setting up my Karma configuration file, but I do not fully understand some of options that exist as I am not having success testing templates that have ran through the ngHtml2JsPreprocessor and have been $templateCached Inside of the ngHtml2JsPreprocessor I can add a few key value properties involving paths. ngHtml2JsPreprocessor: { stripPrefix: ".*/Went all the way back to the root of my application/", // moduleName: 'templatesCached'// }, I commented out the templates for now to make

setting up ng-htmljs-preprocessor karma preprocessor

你离开我真会死。 提交于 2019-12-04 07:51:06
I am setting up my Karma configuration file, but I do not fully understand some of options that exist as I am not having success testing templates that have ran through the ngHtml2JsPreprocessor and have been $templateCached Inside of the ngHtml2JsPreprocessor I can add a few key value properties involving paths. ngHtml2JsPreprocessor: { stripPrefix: ".*/Went all the way back to the root of my application/", // moduleName: 'templatesCached'// }, I commented out the templates for now to make sure that I am getting access to each file as module. I am loading the modules with no error. I can find

Karma throws error: Can not load “ng-html2js”, it is not registered

孤街浪徒 提交于 2019-11-27 15:26:13
I'm getting an error when I run karma start : $ karma start INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/ INFO [launcher]: Starting browser Chrome WARN [preprocess]: Can not load "ng-html2js", it is not registered! Perhaps you are missing some plugin? ... But in my package file I have "karma-ng-html2js-preprocessor": "*", and the folder with code for this preprocessor exists in node_modules . Any ideas on how to solve the problem? Ph0en1x In my cases, the problem was connected to lack of karma-ng-html2js-preprocessor inside karma config plugins sections. In tutorials I

Karma throws error: Can not load “ng-html2js”, it is not registered

一曲冷凌霜 提交于 2019-11-26 17:09:16
问题 I'm getting an error when I run karma start : $ karma start INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/ INFO [launcher]: Starting browser Chrome WARN [preprocess]: Can not load "ng-html2js", it is not registered! Perhaps you are missing some plugin? ... But in my package file I have "karma-ng-html2js-preprocessor": "*", and the folder with code for this preprocessor exists in node_modules . Any ideas on how to solve the problem? 回答1: In my cases, the problem was