Browse Source

feat(client): remove formBuilder injection

pull/6724/head
KenTandrian 1 month ago
parent
commit
1eba8020ec
  1. 25
      apps/client/src/app/components/home-watchlist/create-watchlist-item-dialog/create-watchlist-item-dialog.component.ts

25
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<GfCreateWatchlistItemDialogComponent>>(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<SymbolProfile | null>(null, [
Validators.required
@ -54,7 +43,9 @@ export class GfCreateWatchlistItemDialogComponent implements OnInit {
validators: this.validator
}
);
}
private readonly dialogRef =
inject<MatDialogRef<GfCreateWatchlistItemDialogComponent>>(MatDialogRef);
protected onCancel() {
this.dialogRef.close();

Loading…
Cancel
Save