我目前正在使用与Karma一起运行的ngx-bootstrap遇到问题。 问题是" Chrome 57.0.2987(Windows 10 0.0.0)错误 未捕获的TypeError:无法读取属性'输出'未定义的 在node_modules / ngx-bootstrap / bundles / ngx-bootstrap.umd.js:8087 "
我正在使用角度4.0.0和" ngx-bootstrap":" ^ 1.6.6"。这是我的配置
1。 package.json
"dependencies":
{
"@angular/common": "~4.0.0",
........................
"ngx-bootstrap": "^1.6.6"
}
2。 Systemjs.config.js
System.config({
......................
map: {
// angular bundles
..............................
'ngx-bootstrap': 'npm:ngx-bootstrap/bundles/ngx-bootstrap.umd.js',
}
});
第3。 karma.conf.js
module.exports = function (config) {
..................
config.set({
basePath: '',
frameworks: ['jasmine'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'), // click "Debug" in browser to see it
require('karma-htmlfile-reporter') // crashing w/ strange socket error
],
files: [
...................
'node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.js',
]
............
})
}
请帮我弄清问题。 (Web应用程序与ngx-bootstrap运行良好)
谢谢!
答案 0 :(得分:1)
在karma.conf.js
中,替换:
node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.js
使用:
{
pattern: 'node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.js',
included: false,
watched: false
}
然后它有效。