0

最近我试图将我的 Angular 项目从 8 更新到 9。在更新的同时,我还将 wijmo 从 wijmo/wijmo 更新为 @grapecity/wijmo 包,因为它支持 IVY。

但完成升级后,我可以编译应用程序,但在运行时出现以下错误

global-error-handler.service.ts:43 Error: Uncaught (in promise): TypeError: (0 , t[n]) is not a function
TypeError: (0 , t[n]) is not a function
    at backend.js:61
    at Reflect.<anonymous> (backend.js:61)
    at push../node_modules/@grapecity/wijmo.angular2.grid.detail/__ivy_ngcc__/index.js.__decorate (index.js:28)
    at index.js:53
    at Object../node_modules/@grapecity/wijmo.angular2.grid.detail/__ivy_ngcc__/index.js (index.js:53)
    at __webpack_require__ (bootstrap:84)
4

1 回答 1

0

我想获得有关此错误的更多信息。快速检查的是属性初始化顺序。在 Ivy 中,属性被解释为在标记中指定的(以前 wijmo 控制它们的解释方式)。因此,您可以通过在其他属性之前设置某些属性来破坏组件。

例如,如果我在设置数据源之前尝试在组合框上设置 selectedIndex,那么应用程序将在运行时中断,因为列表中还没有可供选择的项目。

更多信息在这里:https ://www.grapecity.com/wijmo/docs/GettingStarted/Angular-Components#property-initialization-order-in-angular-9-ivy-and-higher

接下来要检查的是组件装饰器(如果您正在继承我们的组件)。Ivy 中的装饰器发生了一些重大变化。

例如,您可能需要添加{descendants: true}到 ContentChildren 查询。

或者你可能需要在@Injectable你的类中添加一个装饰器。

您可以在此处阅读有关 Ivy 中的重大更改以及如何修复它们的更多信息:https ://angular.io/guide/ivy-compatibility-examples

但请随时联系我们直接工作:wijmoexperts@grapecity.com

于 2020-11-04T16:59:29.040 回答