Nativescript 2.2例外

das*_*man 2 nativescript

使用2.2获得以下异常.

正在使用以前的版本.

"tns info"和所有内容都更新为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]
Run Code Online (Sandbox Code Playgroud)

Nik*_*nev 10

我用最新的tns-core-modules和nativescript-angular测试了这个场景,一切都按预期工作.正如@ Panayot.Cankov建议您升级到tns-core-modules@2.2.0nativescript-angular@0.3.0.您可以使用以下命令执行此操作:

  1. tns plugin remove tns-core-modules
  2. tns plugin add tns-core-modules@2.2.0
  3. tns plugin remove nativescript-angular
  4. tns plugin add nativescript-angular@0.3.0