TypeError:在 angular 4.3.2 中使用 angular material/cdk 时,core.defineInjectable 不是函数

Raj*_*esh 4 javascript angular angular-cdk

我想使用角度材料进度微调器并添加

import {MatProgressSpinnerModule} from '@angular/material';
Run Code Online (Sandbox Code Playgroud)

在导入数组和组件中添加

还没有尝试使用选择器更新模板并删除它。在任何一种情况下都会出现错误。

我正在使用 system.config.js,并为所有角度材质和 cdk js 文件添加了贴图值。

使用 angular 4.3.2 和 angular material 最新版本。得到以下错误。

errors.ts:42 错误错误:未捕获(承诺):错误:TypeError:core.defineInjectable 不是 eval 的函数(http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd .js:89:62 ) 在 Object.eval ( http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:91:2 ) 加载http://localhost:8000 时出错 /app/UMSClient/com/ipc/ums/modules/EnterpriseTree/Enterprise.module.js 在 eval ( http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:89: 62 ) 在 Object.eval ( http://localhost:8000/node_modules/@angular/cdk/bundles/cdk-bidi.umd.js:91:2 ) 加载错误 http://localhost:8000/app/UMSClient/com/ipc/ums/modules/EnterpriseTree/Enterprise.module.js

可能有什么问题?

谢谢,

小智 5

defineInjectable是一个只有 6 个角的函数。您可能一直在使用最新版本的 Angular Material,但它与您当前的版本 (4.3.2) 不兼容。