feat: chains form
This commit is contained in:
28
src/app/pages/settings/chains/chain-form/chain-form.ts
Normal file
28
src/app/pages/settings/chains/chain-form/chain-form.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { ImageUploader } from '../../../../components/image-uploader/image-uploader';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { ChainFormGroup } from '../chain-formgroup';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { UpperfirstPipe } from "../../../../pipes/upperfirst-pipe";
|
||||
|
||||
@Component({
|
||||
selector: 'app-chain-form',
|
||||
imports: [MatFormFieldModule, MatInputModule, ImageUploader, ReactiveFormsModule, TranslatePipe, UpperfirstPipe],
|
||||
templateUrl: './chain-form.html',
|
||||
styles: ``,
|
||||
})
|
||||
export class ChainForm {
|
||||
form = input(new ChainFormGroup())
|
||||
|
||||
get file() {
|
||||
return this.form().controls.image.value;
|
||||
}
|
||||
|
||||
updateFileImage(file: File) {
|
||||
const form = this.form();
|
||||
form.controls.image.patchValue(file);
|
||||
form.controls.image.markAsDirty();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user