Add initial components to proto message field
This commit is contained in:
34
src/app/list-field/list-field.component.ts
Normal file
34
src/app/list-field/list-field.component.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
input,
|
||||
model,
|
||||
} from '@angular/core';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { ProtoFieldComponent } from '../proto-field/proto-field.component';
|
||||
import {
|
||||
EnumMessage,
|
||||
ListMessage,
|
||||
ProtoMessageField,
|
||||
} from '../model/proto-message.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-field',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatButton, MatIconModule, ProtoFieldComponent],
|
||||
template: ` @for(value of values(); track values()) {
|
||||
<app-proto-field
|
||||
[configuration]="configuration().subConfiguration"
|
||||
[value]="value"
|
||||
></app-proto-field>
|
||||
}
|
||||
<button mat-icon-button><mat-icon>add</mat-icon></button>`,
|
||||
styleUrl: './list-field.component.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ListFieldComponent {
|
||||
configuration = input.required<ListMessage>();
|
||||
values = model<any[]>();
|
||||
}
|
||||
Reference in New Issue
Block a user