本文介绍了Nativescript 2.2异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在2.2中获得以下异常.
Getting the following exception with 2.2.
与以前的版本一起使用.
Was working with previous version.
输入了"tns信息",所有内容均更新为2.2
Did "tns info" and all is updated to 2.2
JS: Error: Uncaught (in promise): EXCEPTION: Error in pages/listview/listview.html:12:2
JS: ORIGINAL EXCEPTION: TypeError: _this.cssClasses(...).set is not a function
JS: ORIGINAL STACKTRACE:
JS: TypeError: _this.cssClasses(...).set is not a function
JS: at /data/data/org.nativescript.test1/files/app/tns_modules/nativescript-angular/view-util.js:254:78
JS: at Array.forEach (native)
JS: at ViewUtil.setClasses (/data/data/org.nativescript.test1/files/app/tns_modules/nativescript-angular/view-util.js:254:17)
JS: at ViewUtil.setPropertyInternal (/data/data/org.nativescript.test1/files/app/tns_modules/nativescript-angular/view-util.js:189:18)
JS: at ViewUtil.setProperty (/data/data/org.nativescript.test1/files/app/tns_modules/nativescript-angular/view-util.js:181:18)
JS: at NativeScriptRenderer.setElementProperty (/data/data/org.nativescript.test1/files/app/tns_modules/nativescript-angular/renderer.js:141:23)
JS: at NativeScriptRenderer.setElementAttribute (/data/data/org.nativescript.test1/files/app/tns_modules/nativescript-angular/renderer.js:145:21)
JS: at DebugAppView._View_ListviewPage0.createInternal (ListviewPage.template.js:58:17)
JS: at DebugAppView.AppView.create (/data/data/org.nativescript.test1/files/app/tns_modules/@angular/core/src/linker/view.js:87:21)
JS: at DebugAppView.create (/data/data/org.nativescript.test1/files/app/tns_modules/@angular/core/src/linker/view.js:299:44)
JS: ERROR CONTEXT:
JS: [object Object]
推荐答案
我使用最新的tns-core-modules和nativescript-angular测试了此方案,并且一切正常.正如@ Panayot.Cankov建议的那样,您应该升级到[email protected]
和[email protected]
.您可以使用以下命令来做到这一点:
I tested this scenario with latest tns-core-modules and nativescript-angular and everything works as expected. As @Panayot.Cankov suggested you should upgrade to [email protected]
and [email protected]
. You could do that using following commands:
-
tns plugin remove tns-core-modules
-
tns plugin add [email protected]
-
tns plugin remove nativescript-angular
-
tns plugin add [email protected]
tns plugin remove tns-core-modules
tns plugin add [email protected]
tns plugin remove nativescript-angular
tns plugin add [email protected]
这篇关于Nativescript 2.2异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!