ag-grid - AG-Grid + Angular 6 = 兼容?
问题描述
刚开始使用 Angular,所以显然使用 NG6
试图用 AG-Grid 创建一个演示来证明付费版本的成本是合理的,但是按照他们网站上的简单步骤开始操作会给我以下错误。让我首先确保该组件与 Angular 6 兼容?
干杯,N
Uncaught Error: Template parse errors:
Can't bind to 'rowData' since it isn't a known property of 'ag-grid-angular'.
1. If 'ag-grid-angular' is an Angular component and it has 'rowData' input, then verify that it is part of this module.
2. If 'ag-grid-angular' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. (" style="width: 500px; height: 500px;"
class="ag-theme-balham"
[ERROR ->][rowData]="rowData"
[columnDefs]="columnDefs">
</ag-grid-angular>
"): ng:///AppModule/AppComponent.html@11:16
Can't bind to 'columnDefs' since it isn't a known property of 'ag-grid-angular'.
1. If 'ag-grid-angular' is an Angular component and it has 'columnDefs' input, then verify that it is part of this module.
2. If 'ag-grid-angular' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
class="ag-theme-balham"
[rowData]="rowData"
[ERROR ->][columnDefs]="columnDefs">
</ag-grid-angular>
"): ng:///AppModule/AppComponent.html@12:16
'ag-grid-angular' is not a known element:
1. If 'ag-grid-angular' is an Angular component, then verify that it is part of this module.
2. If 'ag-grid-angular' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<div class="col-10">
[ERROR ->]<ag-grid-angular
style="width: 500px; height: 500px;"
class="ag-t"): ng:///AppModule/AppComponent.html@8:12
at syntaxError (compiler.js:215)
at TemplateParser.push../node_modules/@angular/compiler/fesm5/compiler.js.TemplateParser.parse (compiler.js:14702)...
解决方案
是的,它是兼容的。
我一直是个白痴,在 app-routing.module 而不是 app.module 中添加了代码。(n00b!!)
推荐阅读
- android - 为什么 Livedata setValue 在调用两次时会被忽略?
- python - 我是 Python 新手。而且这个递归程序往往因为一些我无法弄清楚的奇怪原因而无法运行。任何帮助将不胜感激
- python-3.x - Django 在 Django 模型中创建数组
- java - 访问资产文件时出现 FileNotFoundException
- r - 编辑 tabitems 后,R 在 Shiny DashBoard 上渲染失败
- bash - 从包含要执行的可执行命令的 .txt 文件中读取,将执行的命令的输出发送到另一个文件
- r - 使用 dplyr,我应该如何根据另一列的值创建一列重复字符的字符串?
- android - Android 通知 setLargeIcon() 不起作用
- java - 考虑到缺少 EOF,如何从 Java 中的标准输入中读取?
- javascript - Reactjs - 未捕获的类型错误:无法读取未定义的属性“fullName”