|
| 1 | +import {ChangeDetectionStrategy, Component, output, signal} from '@angular/core'; |
| 2 | +import {MatTableModule} from '@angular/material/table'; |
| 3 | +import {MatCardModule} from '@angular/material/card'; |
| 4 | +import {MatButtonModule} from '@angular/material/button'; |
| 5 | +import {MatIconModule} from '@angular/material/icon'; |
| 6 | + |
| 7 | +@Component({ |
| 8 | + selector: 'app-configurator', |
| 9 | + imports: [MatTableModule, MatCardModule, MatButtonModule, MatIconModule], |
| 10 | + templateUrl: './configurator-component.html', |
| 11 | + styleUrl: './configurator-component.css', |
| 12 | + changeDetection: ChangeDetectionStrategy.OnPush, |
| 13 | +}) |
| 14 | +export class ConfiguratorComponent { |
| 15 | + readonly data = signal([ |
| 16 | + { |
| 17 | + name: 'Sample Configuration', |
| 18 | + description: 'This is a sample configuration for demonstration purposes.', |
| 19 | + }, |
| 20 | + { |
| 21 | + name: 'Sample Configuration', |
| 22 | + description: 'This is a sample configuration for demonstration purposes.', |
| 23 | + }, |
| 24 | + { |
| 25 | + name: 'Sample Configuration', |
| 26 | + description: 'This is a sample configuration for demonstration purposes.', |
| 27 | + }, |
| 28 | + { |
| 29 | + name: 'Sample Configuration', |
| 30 | + description: 'This is a sample configuration for demonstration purposes.', |
| 31 | + }, |
| 32 | + { |
| 33 | + name: 'Sample Configuration', |
| 34 | + description: 'This is a sample configuration for demonstration purposes.', |
| 35 | + }, |
| 36 | + ]); |
| 37 | + |
| 38 | + displayedColumns: string[] = ['name', 'description']; |
| 39 | + |
| 40 | + createConfiguration = output<void>(); |
| 41 | + |
| 42 | + onCreateClicked(): void { |
| 43 | + this.createConfiguration.emit(); |
| 44 | + } |
| 45 | +} |
0 commit comments