Browse Source

Refactoring

pull/2056/head
Thomas 2 years ago
parent
commit
a2f05264af
  1. 12
      libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

12
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

@ -73,7 +73,7 @@ export class SymbolAutocompleteComponent
this.controlType = 'symbol-autocomplete'; this.controlType = 'symbol-autocomplete';
} }
public ngOnInit(): void { public ngOnInit() {
super.required = this.ngControl.control?.hasValidator(Validators.required); super.required = this.ngControl.control?.hasValidator(Validators.required);
if (this.disabled) { if (this.disabled) {
@ -107,21 +107,21 @@ export class SymbolAutocompleteComponent
return aLookupItem?.symbol ?? ''; return aLookupItem?.symbol ?? '';
} }
public get empty(): boolean { public get empty() {
return this.input?.empty; return this.input?.empty;
} }
public focus(): void { public focus() {
this.input.focus(); this.input.focus();
} }
public isValueInOptions(value: string): boolean { public isValueInOptions(value: string) {
return this.filteredLookupItems.some((item) => { return this.filteredLookupItems.some((item) => {
return item.symbol === value; return item.symbol === value;
}); });
} }
public ngDoCheck(): void { public ngDoCheck() {
if (this.ngControl) { if (this.ngControl) {
this.validateRequired(); this.validateRequired();
this.validateSelection(); this.validateSelection();
@ -142,7 +142,7 @@ export class SymbolAutocompleteComponent
super.value = value; super.value = value;
} }
public ngOnDestroy(): void { public ngOnDestroy() {
super.ngOnDestroy(); super.ngOnDestroy();
this.unsubscribeSubject.next(); this.unsubscribeSubject.next();

Loading…
Cancel
Save