2017-01-12 24 views
0

我目前正在使用angular2项目,它使用kendo-ui scrollview for angular2 今天,当我打开我的代码并执行npm安装并运行项目时出现错误 是满堆栈跟踪']在滚动视图中获取错误角色2的组件Kendo UI

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" 
"): [email protected]:32 
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in [email protected]:32 (" 
    </a> 
    <kendo-scrollview-pager *ngIf(pageable) 
     [ERROR ->](pagerIndexChange)="pageChange($event)" 
     [data]="data" 
     [activeIndex]="activeIndex""): [email protected]:10 
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in [email protected]:32 ("<kendo-scrollview-pager *ngIf(pageable) 
     (pagerIndexChange)="pageChange($event)" 
     [ERROR ->][data]="data" 
     [activeIndex]="activeIndex"> 
    </kendo-scrollview-pager> 
"): [email protected]:10 
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in [email protected]:32 (" 
     (pagerIndexChange)="pageChange($event)" 
     [data]="data" 
     [ERROR ->][activeIndex]="activeIndex"> 
    </kendo-scrollview-pager> 
    </div> 
"): [email protected]: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" 
"): [email protected]:32 
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in [email protected]:32 (" 
    </a> 
    <kendo-scrollview-pager *ngIf(pageable) 
     [ERROR ->](pagerIndexChange)="pageChange($event)" 
     [data]="data" 
     [activeIndex]="activeIndex""): [email protected]:10 
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in [email protected]:32 ("<kendo-scrollview-pager *ngIf(pageable) 
     (pagerIndexChange)="pageChange($event)" 
     [ERROR ->][data]="data" 
     [activeIndex]="activeIndex"> 
    </kendo-scrollview-pager> 
"): [email protected]:10 
Parser Error: Unexpected token :, expected identifier, keyword, or string at column 1 in [] in [email protected]:32 (" 
     (pagerIndexChange)="pageChange($event)" 
     [data]="data" 
     [ERROR ->][activeIndex]="activeIndex"> 
    </kendo-scrollview-pager> 
    </div> 
"): [email protected]: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

你可以提供一个plunkr? – knikolov

+0

现在不可能,因为我现在不使用Kendo UI来滚动视图,因为Kendo UI仍然处于测试状态 – Kaushal

回答

0

我也有同样的问题。这是一个已知的问题,Telerik将最终修复它。

遵循问题:https://github.com/telerik/kendo-angular2/issues/203

它有事情做与不能够支持新的Angular2版(发布前几天)。

今天(2017年1月24日)发布的最新更新修复了此问题。更新你的软件包,它会自行修复。

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 "

让我知道这是否正常工作