要实现Angular Kendo网格视图、列表视图和详细视图,可以按照以下步骤进行操作:
npm install --save @progress/kendo-angular-grid @progress/kendo-angular-dropdowns
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { GridModule } from '@progress/kendo-angular-grid';
import { DropDownListModule } from '@progress/kendo-angular-dropdowns';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, BrowserAnimationsModule, GridModule, DropDownListModule],
bootstrap: [AppComponent]
})
export class AppModule { }
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
`
})
export class AppComponent {
public gridData: any[] = [
{
"CompanyName": "Alfreds Futterkiste",
"ContactName": "Maria Anders",
"ContactTitle": "Sales Representative",
"Country": "Germany",
"City": "Berlin",
"Products": [
{ "ProductName": "Chai", "UnitPrice": 18 },
{ "ProductName": "Aniseed Syrup", "UnitPrice": 10 }
]
},
{
"CompanyName": "Around the Horn",
"ContactName": "Thomas Hardy",
"ContactTitle": "Sales Representative",
"Country": "UK",
"City": "London",
"Products": [
{ "ProductName": "Chang", "UnitPrice": 19 },
{ "ProductName": "Carnarvon Tigers", "UnitPrice": 20 }
]
}
];
}
ng serve
这样就可以在Angular应用程序中使用Angular Kendo网格视图、列表视图和详细视图了。请根据实际需求修改数据和模板。