我是angular2的新手。在我的基本angular2项目中,我尝试放置ag。我得到了错误
node_modules/ag-grid-ng2/lib/ng2ComponentFactory.d.ts(3,10): error TS2305: Module
'"C:/practice/quickstart/node_modules/@angular/compiler/index"' has no exported member 'RuntimeCompiler'.package.json
"ag-grid": "6.4.x",
"ag-grid-enterprise": "6.4.x",
"ag-grid-ng2": "6.4.x",systemjs.config.js
'ag-grid': 'node_modules/ag-grid',
'ag-grid-ng2': 'node_modules/ag-grid-ng2'
packages: {
'ag-grid-ng2': {
defaultExtension: "js"
},
'ag-grid': {
defaultExtension: "js"
},
}app.module.ts
import {AgGridModule} from 'ag-grid-ng2/main';
@NgModule({
imports: [
BrowserModule,
AgGridModule.withNg2ComponentSupport(),
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }在app.module.ts文件中,withNg2ComponentSupport()收到错误。
发布于 2017-01-12 17:43:05
从你的消息中我猜你正在使用angular 2 2.3+ -如果是这样,那么问题是ag-grid-ng2 6.x不支持这个版本。
Angular 2使ag ng2所依赖的RuntimeCompiler不公开(好吧,移动了它等等)。
如果你想使用Angular网格,那么你需要升级到支持它的ag- 2.3+ -ng2 7.x
https://stackoverflow.com/questions/41605477
复制相似问题