AngularJS + Karma + Ng-html2js => Failed to instantiate module …html

后端 未结 4 897
深忆病人
深忆病人 2021-02-02 09:28

I can\'t make Karma working for directives that have external templates.

Here is my karma configuration file :

pr         


        
4条回答
  •  滥情空心
    2021-02-02 10:05

    I'm in the process of learning AngularJS and ran into the same problem. I have no idea why but changing the port in karma.conf.js fixed it for me.

    module.exports = function(config){
      config.set({
    
        ...
    
        port: 9877,
    
        ...
    
      });
    };
    

    Edit:

    After a bit more testing I found that the problem was only happening on Chrome, and was resolved by explicitly clearing all of the browser history (Ctrl + F5 didn't work).

提交回复
热议问题