我正在尝试使用Angular Material集成和运行Ionic 3,但未能做到这一点 . ......任何人都可以告诉我如何向Ionic添加第三方 . 以及如何在Ionic Framework中运行Angular Material . .....我做的是以下::
- 我安装了
@angular/material, @angular/cdk
和@angular/animations
.
使用以下内容在config文件夹中添加 copy.config.js
文件::
copyMaterialThemeCSS:{src:['{} / node_modules/@angular/material/prebuilt-themes/indigo-pink.css'],dest:'{} / assets'}
-Edit in Package.json
添加以下内容:
“config”:{“ionic_copy”:“ . / config / copy.config.js”}
-in Index.html我添加了这一行:
<link href="assets/indigo-pink.css" rel="stylesheet">
- 最后,当从Angular Material添加任何组件时,我收到此错误:
TypeError: Object(...) is not a function
at http://localhost:8100/build/vendor.js:138867:128
at Object.<anonymous> (http://localhost:8100/build/vendor.js:138869:2)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.<anonymous> (http://localhost:8100/build/vendor.js:135975:76)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.<anonymous> (http://localhost:8100/build/vendor.js:147347:81)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.218 (http://localhost:8100/build/main.js:116:82)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.195 (http://localhost:8100/build/main.js:96:70)
...
先感谢您 .
1 回答
我从youtube上听了这个回答并解决了我的问题: