ag-grid로 실험 중이며 아주 간단한 예제가 작동하려고합니다. 지금까지 나는 운이별로 없다.샘플 ag-grid 예제를 복사하고 서로 위에 셀 렌더링을 사용하십시오.
ng new gridTest
을 사용하여 새로운 앱을 만들었으며 these 지침을 따르려고했습니다.
내가 만든 샘플 사이트는 here입니다.
내 결과 그리드는 다음과 같습니다
app.component.html :
<ag-grid-angular style="width: 500px; height: 115px;" class="ag-theme-fresh"
[rowData]="rowData"
[columnDefs]="columnDefs">
</ag-grid-angular>
app.component.ts :
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
public rowData = [
{ make: "Toyota", model: "Celica", price: 35000 },
{ make: "Ford", model: "Mondeo", price: 32000 },
{ make: "Porsche", model: "Boxter", price: 72000 }
]
public columnDefs = [
{ headerName: "Make", field: "make" },
{ headerName: "Model", field: "model" },
{ headerName: "Price", field: "price" }
]
}
app.module. ts :
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AgGridModule } from 'ag-grid-angular/main';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AgGridModule.withComponents([])
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
내가 뭘 잘못하고 있니? 나는이 아주 간단한 예제로 스타일이나 다른 것을 엉망으로 만든 것을 볼 수 없다 ...