Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 因果报应错误无法调用方法';模块';未定义的_Angularjs_Jasmine_Karma Runner - Fatal编程技术网

Angularjs 因果报应错误无法调用方法';模块';未定义的

Angularjs 因果报应错误无法调用方法';模块';未定义的,angularjs,jasmine,karma-runner,Angularjs,Jasmine,Karma Runner,我在运行test.sh时遇到此错误。(我想我从aungular种子项目中获得了test.sh) 为什么?您需要在karma.conf.js文件中包含angular.js:'public/lib/angular*/angular.js' 这解决了我的问题,但也许还有更好的方法。另见 config/karma.conf.js: INFO [Chrome 26.0.1410 (Linux)]: Connected on socket gB-olqxn3xDa6fV2ENBw Chrome 26.0.1

我在运行
test.sh
时遇到此错误。(我想我从aungular种子项目中获得了test.sh)


为什么?

您需要在karma.conf.js文件中包含angular.js:
'public/lib/angular*/angular.js'

这解决了我的问题,但也许还有更好的方法。另见

config/karma.conf.js:
INFO [Chrome 26.0.1410 (Linux)]: Connected on socket gB-olqxn3xDa6fV2ENBw
Chrome 26.0.1410 (Linux) ERROR
    Uncaught TypeError: Cannot call method 'module' of undefined
    at /home/me/git/blah/blah/public/lib/angular-1.0.7/angular-cookies.js:15
// list of files / patterns to load in the browser
files: [
  'public/lib/angular*/angular.js',
  'public/lib/**/*.js',
  'public/js/**/*.js',
  'routes/**/*.js',
  'server/**/*.js',
  'test/unit/**/*Spec.js'
],