我正在使用ng2和kendo-ui网格组件。直到我去添加另一个属性到kendo网格组件时,我才有了问题,现在我似乎陷入了一些奇怪的编译器赋格状态。错误代码删除后Angular2模板解析错误
错误在Chrome浏览器开发控制台:
Unexpected character "a" ("
</kendo-grid-column>
</kendo-grid
[ERROR ->]appRowClick
[ngStyle]="{
'height': showAdditionalFilters ? 'calc(100vh - 280px)' : 'calc("): ng:///FooBarModule/[email protected]:4
Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) ("
'width': 'calc(100vw - 130px)'}">
</div>
[ERROR ->]"): ng:///FooBarModule/[email protected]:0
Invalid ICU message. Missing '}'. ("
'width': 'calc(100vw - 130px)'}">
</div>
[ERROR ->]"): ng:///FooBarModule/[email protected]:0
at syntaxError (compiler.es5.js:1690)
at DirectiveNormalizer.normalizeLoadedTemplate (compiler.es5.js:14132)
at compiler.es5.js:14118
at Object.then (compiler.es5.js:1679)
at DirectiveNormalizer.normalizeTemplateOnly (compiler.es5.js:14118)
at DirectiveNormalizer.normalizeTemplate (compiler.es5.js:14100)
at CompileMetadataResolver.loadDirectiveMetadata (compiler.es5.js:15129)
at compiler.es5.js:26806
at Array.forEach (<anonymous>)
at compiler.es5.js:26805
foo.bar.html(与ngStyle):
<kendo-grid
appRowClick
[ngStyle]="{
'height': showAdditionalFilters ? 'calc(100vh - 280px)' : 'calc(100vh - 180px)',
'width': 'calc(100vw - 130px)'}"
[data]="gridData"
[selectable]="true"
[sortable]="true"
(selectionChange)="selectionChange($event)"
(dataStateChange)="dataStateChange($event)">...</kendo-grid>
所以我删除整个[ngStyle]输入预计会解决问题,但我仍然收到错误。该代码不存在于应用程序的其他任何地方。
有谁知道可能是什么问题?我试过重新启动ng serve
和刷新浏览器,但似乎都没有工作。
foo.bar.html(不ngStyle):
<kendo-grid
appRowClick
[data]="gridData"
[selectable]="true"
[sortable]="true"
(selectionChange)="selectionChange($event)"
(dataStateChange)="dataStateChange($event)">...</kendo-grid>
除了线休息,你的ngStyle指令看起来很好。什么是'appRowClick'属性? – Trent
它是否会编译,如果你删除“appRowClick”? – vidalsasoon
我已经删除了'appRowClick'指令并将ngStyle绑定表达式移到了同一行,而且我仍然看到问题。 – Blexy