From 1eba8020ecc729118b4b8345cdb92a3b470376e4 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sat, 11 Apr 2026 23:28:57 +0700 Subject: [PATCH] feat(client): remove formBuilder injection --- .../create-watchlist-item-dialog.component.ts | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/apps/client/src/app/components/home-watchlist/create-watchlist-item-dialog/create-watchlist-item-dialog.component.ts b/apps/client/src/app/components/home-watchlist/create-watchlist-item-dialog/create-watchlist-item-dialog.component.ts index c4191025b..a284991e2 100644 --- a/apps/client/src/app/components/home-watchlist/create-watchlist-item-dialog/create-watchlist-item-dialog.component.ts +++ b/apps/client/src/app/components/home-watchlist/create-watchlist-item-dialog/create-watchlist-item-dialog.component.ts @@ -1,14 +1,9 @@ import { GfSymbolAutocompleteComponent } from '@ghostfolio/ui/symbol-autocomplete'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { - ChangeDetectionStrategy, - Component, - inject, - OnInit -} from '@angular/core'; -import { - FormBuilder, FormControl, + FormGroup, FormsModule, ReactiveFormsModule, ValidationErrors, @@ -36,15 +31,9 @@ import { CreateWatchlistItemForm } from './interfaces/interfaces'; styleUrls: ['./create-watchlist-item-dialog.component.scss'], templateUrl: 'create-watchlist-item-dialog.html' }) -export class GfCreateWatchlistItemDialogComponent implements OnInit { - protected createWatchlistItemForm: CreateWatchlistItemForm; - - private readonly dialogRef = - inject>(MatDialogRef); - private readonly formBuilder = inject(FormBuilder); - - public ngOnInit() { - this.createWatchlistItemForm = this.formBuilder.group( +export class GfCreateWatchlistItemDialogComponent { + protected readonly createWatchlistItemForm: CreateWatchlistItemForm = + new FormGroup( { searchSymbol: new FormControl(null, [ Validators.required @@ -54,7 +43,9 @@ export class GfCreateWatchlistItemDialogComponent implements OnInit { validators: this.validator } ); - } + + private readonly dialogRef = + inject>(MatDialogRef); protected onCancel() { this.dialogRef.close();