angular - 我将 Angular 5 更新到 8,但我在 toastr 上出现错误
问题描述
我将我的角度 5 更新为 8
当我启动(ng 服务器)时,控制台上出现此错误
Uncaught TypeError: core_1.style is not a function
at Object../node_modules/ng2-toastr/src/toast-container.component.js (toast-container.component.js:118)
at __webpack_require__ (bootstrap:84)
at Object../node_modules/ng2-toastr/src/toast-manager.js (toast-manager.js:4)
at __webpack_require__ (bootstrap:84)
at Object../node_modules/ng2-toastr/ng2-toastr.js (ng2-toastr.js:5)
at __webpack_require__ (bootstrap:84)
at Module../src/app/app.module.ts (app.error-handle.ts:6)
at __webpack_require__ (bootstrap:84)
at Module../src/main.ts (main.ts:1)
at __webpack_require__ (bootstrap:84)
at Object.0 (main.ts:12)
at __webpack_require__ (bootstrap:84)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.js:1
我已经做了这个命令:
npm i ng2
npm i ng2-toastr
角度版本
解决方案
它可能正在使用@ViewChild
or @ContentChild
,这些在 Angular 8 中发生了重大变化。由于该软件包已经 2 年没有更新,您可能应该寻找另一个库。
推荐阅读
- javascript - 比较此函数中的数字的最简单方法是什么?
- python - 使用 2 列将函数应用于所有行并创建新列
- firebase - 在 Firebase 数据库中添加带有数量的项目的 Swift 代码
- javascript - 带有autotable插件表的jsPDF不服从html元素属性值从右到左的文本方向,例如
- node.js - Puppeteer 不能仅识别类型和类的选择器,但接受完整的选择器
- sql - 如何将带有连接的 Oracle (+) 运算符转移到 Spark SQL?
- javascript - 从父母到孩子的反应传递道具行为异常
- java - 扩展我自己的 BaseActivity 导致 java.lang.NoClassDefFoundError
- c - 将 free 与指向结构的双指针一起使用
- javascript - 如何将此 jQuery 代码转换为纯 JavaScript?