authentication
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<ag-grid-angular
|
||||
style="width: 100%; height: 100%;"
|
||||
|
||||
[rowData]="rowData"
|
||||
[columnDefs]="colDefs"
|
||||
[defaultColDef]="defaultColDef"
|
||||
/>
|
||||
23
client/src/app/modules/dashboard/dashboard.component.spec.ts
Normal file
23
client/src/app/modules/dashboard/dashboard.component.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DashboardComponent } from './dashboard.component';
|
||||
|
||||
describe('DashboardComponent', () => {
|
||||
let component: DashboardComponent;
|
||||
let fixture: ComponentFixture<DashboardComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [DashboardComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(DashboardComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
51
client/src/app/modules/dashboard/dashboard.component.ts
Normal file
51
client/src/app/modules/dashboard/dashboard.component.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { AgGridAngular } from 'ag-grid-angular';
|
||||
import { ColDef } from 'ag-grid-community'; // Column Definition Type Interface
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
standalone: true,
|
||||
imports: [AgGridAngular],
|
||||
templateUrl: './dashboard.component.html',
|
||||
styleUrl: './dashboard.component.scss'
|
||||
})
|
||||
export class DashboardComponent {
|
||||
|
||||
defaultColDef: ColDef = {
|
||||
flex: 1,
|
||||
editable: true
|
||||
};
|
||||
rowData = [
|
||||
{ make: "Tesla", model: "Model Y", price: 64950, electric: true },
|
||||
{ make: "Ford", model: "F-Series", price: 33850, electric: false },
|
||||
{ make: "Toyota", model: "Corolla", price: 29600, electric: false },
|
||||
{ make: "Tesla", model: "Model Y", price: 64950, electric: true },
|
||||
{ make: "Ford", model: "F-Series", price: 33850, electric: false },
|
||||
{ make: "Toyota", model: "Corolla", price: 29600, electric: false },
|
||||
{ make: "Tesla", model: "Model Y", price: 64950, electric: true },
|
||||
{ make: "Ford", model: "F-Series", price: 33850, electric: false },
|
||||
{ make: "Toyota", model: "Corolla", price: 29600, electric: false },
|
||||
{ make: "Tesla", model: "Model Y", price: 64950, electric: true },
|
||||
];
|
||||
|
||||
// Column Definitions: Defines the columns to be displayed.
|
||||
colDefs: ColDef[] = [
|
||||
{ field: "make" },
|
||||
{
|
||||
field: "model",
|
||||
cellEditor: 'agSelectCellEditor',
|
||||
singleClickEdit: true,
|
||||
cellEditorParams: {
|
||||
values: ['English', 'Spanish', 'French', 'Portuguese', '(other)'],
|
||||
}
|
||||
},
|
||||
{ field: "price", type: 'number'
|
||||
// cellEditor: 'agDateCellEditor',
|
||||
// cellEditorParams: {
|
||||
// min: '2000-01-01',
|
||||
// max: '2019-12-31',
|
||||
// }
|
||||
},
|
||||
{ field: "electric", editable: true }
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user