From c8bed4ed53ad55c80c90bb84fc81c9a6225b66f7 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sun, 8 Mar 2026 13:48:14 +0700 Subject: [PATCH] feat(lib): implement view child signal for input --- .../symbol-autocomplete/symbol-autocomplete.component.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts index 2b4cdc371..854ccce9e 100644 --- a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts +++ b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts @@ -16,7 +16,6 @@ import { OnChanges, OnInit, SimpleChanges, - ViewChild, viewChild } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; @@ -86,8 +85,6 @@ export class GfSymbolAutocompleteComponent @Input() private includeIndices = false; - @ViewChild(MatInput) private input: MatInput; - public readonly control = new FormControl(); public lookupItems: (LookupItem & { assetSubClassString: string })[] = []; @@ -95,6 +92,7 @@ export class GfSymbolAutocompleteComponent viewChild.required('symbolAutocomplete'); private readonly destroyRef = inject(DestroyRef); + private readonly input = viewChild.required(MatInput); public constructor( public readonly _elementRef: ElementRef, @@ -109,7 +107,7 @@ export class GfSymbolAutocompleteComponent } public get empty() { - return this.input?.empty; + return this.input().empty; } public set value(value: LookupItem) { @@ -181,7 +179,7 @@ export class GfSymbolAutocompleteComponent } public focus() { - this.input.focus(); + this.input().focus(); } public isValueInOptions(value: string) {