ReferenceError: module is not defined - Karma/Jasmine configuration with Angular/Laravel app

前端 未结 4 1058

I have an existing Angular/Laravel app in which Laravel acts as an API to the angular frontend serving only JSON data. The page that loads the angular app, index.php

4条回答
  •  一个人的身影
    2021-02-04 23:56

    The error means angular was not able to inject your module. Most of the time this happens because of missing reference to script files. In this case, make sure to have all your script file is defined under [files] configuration of karma. Pay special attention to paths because if your script folder has nested structure, make sure to list as such. For example:

    Scripts/Controllers/One/1.js 
    Scripts/Controllers/One/2.js 
    

    can be listed as in karma.conf.js>files as :

    Scripts/Controllers/**/*.js
    

提交回复
热议问题