我目前正在开发angular2项目,该项目使用了用于angular2的kendo-ui scrollview 今天,当我打开我的代码并执行npm安装并运行项目时,我遇到了错误 这是完整的堆栈跟踪']
Error: Uncaught (in promise): Error: Template parse errors:
TypeError: Cannot read property 'toUpperCase' of undefined (" <span class="k-icon k-i-arrowhead-e"></span>
</a>
<kendo-scrollview-pager [ERROR ->]*ngIf(pageable)
(pagerIndexChange)="pageChange($event)"
[data]="data"
"): ScrollViewComponent@33:32
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in ScrollViewComponent@33:32 ("
</a>
<kendo-scrollview-pager *ngIf(pageable)
[ERROR ->](pagerIndexChange)="pageChange($event)"
[data]="data"
[activeIndex]="activeIndex""): ScrollViewComponent@34:10
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in ScrollViewComponent@33:32 ("<kendo-scrollview-pager *ngIf(pageable)
(pagerIndexChange)="pageChange($event)"
[ERROR ->][data]="data"
[activeIndex]="activeIndex">
</kendo-scrollview-pager>
"): ScrollViewComponent@35:10
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in ScrollViewComponent@33:32 ("
(pagerIndexChange)="pageChange($event)"
[data]="data"
[ERROR ->][activeIndex]="activeIndex">
</kendo-scrollview-pager>
</div>
"): ScrollViewComponent@36:10
Error: Template parse errors:
TypeError: Cannot read property 'toUpperCase' of undefined (" <span class="k-icon k-i-arrowhead-e"></span>
</a>
<kendo-scrollview-pager [ERROR ->]*ngIf(pageable)
(pagerIndexChange)="pageChange($event)"
[data]="data"
"): ScrollViewComponent@33:32
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in ScrollViewComponent@33:32 ("
</a>
<kendo-scrollview-pager *ngIf(pageable)
[ERROR ->](pagerIndexChange)="pageChange($event)"
[data]="data"
[activeIndex]="activeIndex""): ScrollViewComponent@34:10
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in ScrollViewComponent@33:32 ("<kendo-scrollview-pager *ngIf(pageable)
(pagerIndexChange)="pageChange($event)"
[ERROR ->][data]="data"
[activeIndex]="activeIndex">
</kendo-scrollview-pager>
"): ScrollViewComponent@35:10
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in ScrollViewComponent@33:32 ("
(pagerIndexChange)="pageChange($event)"
[data]="data"
[ERROR ->][activeIndex]="activeIndex">
</kendo-scrollview-pager>
</div>
"): ScrollViewComponent@36:10
at SyntaxError.BaseError [as constructor] (http://localhost:4200/vendor.bundle.js:119575:27) [<root>]
at new SyntaxError (http://localhost:4200/vendor.bundle.js:7163:16) [<root>]
at TemplateParser.parse (http://localhost:4200/vendor.bundle.js:26588:19) [<root>]
at JitCompiler._compileTemplate (http://localhost:4200/vendor.bundle.js:66630:68) [<root>]
at http://localhost:4200/vendor.bundle.js:66513:62 [<root>]
at Set.forEach (native) [<root>]
at JitCompiler._compileComponents (http://localhost:4200/vendor.bundle.js:66513:19) [<root>]
at createResult (http://localhost:4200/vendor.bundle.js:66396:19) [<root>]
at Zone.run (http://localhost:4200/vendor.bundle.js:175827:43) [<root> => <root>]
at http://localhost:4200/vendor.bundle.js:176234:57 [<root>]
at Zone.runTask (http://localhost:4200/vendor.bundle.js:175865:47) [<root> => <root>]
at drainMicroTaskQueue (http://localhost:4200/vendor.bundle.js:176132:35) [<root>]
at SyntaxError.BaseError [as constructor] (http://localhost:4200/vendor.bundle.js:119575:27) [<root>]
at new SyntaxError (http://localhost:4200/vendor.bundle.js:7163:16) [<root>]
at TemplateParser.parse (http://localhost:4200/vendor.bundle.js:26588:19) [<root>]
at JitCompiler._compileTemplate (http://localhost:4200/vendor.bundle.js:66630:68) [<root>]
at http://localhost:4200/vendor.bundle.js:66513:62 [<root>]
at Set.forEach (native) [<root>]
at JitCompiler._compileComponents (http://localhost:4200/vendor.bundle.js:66513:19) [<root>]
at createResult (http://localhost:4200/vendor.bundle.js:66396:19) [<root>]
at Zone.run (http://localhost:4200/vendor.bundle.js:175827:43) [<root> => <root>]
at http://localhost:4200/vendor.bundle.js:176234:57 [<root>]
at Zone.runTask (http://localhost:4200/vendor.bundle.js:175865:47) [<root> => <root>]
at drainMicroTaskQueue (http://localhost:4200/vendor.bundle.js:176132:35) [<root>]
at resolvePromise (http://localhost:4200/vendor.bundle.js:176200:31) [<root>]
at resolvePromise (http://localhost:4200/vendor.bundle.js:176185:17) [<root>]
at http://localhost:4200/vendor.bundle.js:176234:17 [<root>]
at Zone.runTask (http://localhost:4200/vendor.bundle.js:175865:47) [<root> => <root>]
at drainMicroTaskQueue (http://localhost:4200/vendor.bundle.js:176132:35) [<root>]
任何人都知道为什么会这样。 itried将所有角度相关的包更新到最新,但错误仍然是他们的。
请帮助
答案 0 :(得分:1)
找到一种方法(暂时)修复它。导航到kendo-angular-scrollview文件夹:\ node_modules \ @progress \ kendo-angular-scrollview \ dist \ es \ scrollview.component.js。
转到第312行并将此代码替换为此处:
template: "\n <ul class='k-scrollview'\n [ngStyle]=\"transitionStyle\"\n [@animateTo]=\"animationState\"\n (@animateTo.done)= \"transitionEndHandler($event)\"\n (kendo.drag) = \"handleDrag($event)\"\n (kendo.press) = \"handlePress($event)\"\n (kendo.release) = \"handleRelease($event)\"\n kendoDraggable>\n <li *ngFor=\"let item of view;let i=index\"\n [ngStyle]=\"inlineStyles(i)\"\n [attr.aria-hidden]=\"i !== 1\">\n <template\n [ngTemplateOutlet]=\"itemTemplateRef\"\n [ngOutletContext]=\"{ item: item }\">\n </template>\n </li>\n </ul>\n <div class='k-scrollview-elements'\n [ngStyle]=\"{'height': height}\"\n *ngIf=\"!isDataSourceEmpty && (pageable||arrows)\">\n <a class=\"k-scrollview-prev\"\n aria-label=\"previous\"\n *ngIf=\"arrows && displayPrevArrow()\"\n (click)=\"prev()\">\n <span class=\"k-icon k-i-arrowhead-w\"></span>\n </a>\n <a class=\"k-scrollview-next\"\n aria-label=\"next\"\n *ngIf=\"arrows && displayNextArrow()\"\n (click)=\"next()\">\n <span class=\"k-icon k-i-arrowhead-e\"></span>\n </a>\n </div>\n "
让我知道这是否有效
答案 1 :(得分:0)
我也有同样的问题。这是一个已知问题,Telerik最终会解决它。
要解决此问题:https://github.com/telerik/kendo-angular2/issues/203
这与无法支持新的Angular2版本(几天前发布)有关。
今天发布的最新更新(2017年1月24日)已解决此问题。更新您的软件包,它将自行修复。