【发布时间】:2018-03-01 09:25:57
【问题描述】:
尝试集成 Angular 4 + @ngx-translate。一切都在使用npm start 正常执行和工作。当我尝试npm test 运行 Karma 测试用例时出现问题。所有这些都是在添加 @ngx-translate 功能之后开始的。
控制台出现以下错误:
20 09 2017 14:24:30.334:INFO [Chrome 60.0.3112 (Windows 7 0.0.0)]: Connected on socket n1uvSjMzMfCGU26zAAAA with id 7587189
Chrome 60.0.3112 (Windows 7 0.0.0) ERROR
Uncaught TypeError: Cannot read property 'Injectable' of undefined
at node_modules/@ngx-translate/core/bundles/core.umd.js:817
在浏览器控制台上:
Uncaught TypeError: Cannot read property 'Injectable' of undefined
at Object.<anonymous> (core.umd.js:817)
at __webpack_require__ (core.umd.js:30)
at Object.module.exports (core.umd.js:1421)
at __webpack_require__ (core.umd.js:30)
at module.exports (core.umd.js:76)
at core.umd.js:79
at webpackUniversalModuleDefinition (core.umd.js:9)
at core.umd.js:10
ng-bootstrap.js:9 Uncaught TypeError: Cannot read property 'core' of undefined
at webpackUniversalModuleDefinition (ng-bootstrap.js:9)
at ng-bootstrap.js:10
在浏览器上:
OtherComponent when inside a test host should process Instance name
TypeError: Cannot read property 'bpmWrapWorkItemList' of undefined
TypeError: Cannot read property 'bpmWrapWorkItemList' of undefined
请帮忙!!!我是 Angular 4 的新手..
【问题讨论】:
标签: karma-jasmine bootstrap-4 translate ngx-translate