Refactoring
This commit is contained in:
parent
532ba51a59
commit
3f5f0fb641
@ -36,10 +36,10 @@ import { AliasEntityType, EntityType } from '@shared/models/entity-type.models';
|
|||||||
import { BaseData } from '@shared/models/base-data';
|
import { BaseData } from '@shared/models/base-data';
|
||||||
import { EntityId } from '@shared/models/id/entity-id';
|
import { EntityId } from '@shared/models/id/entity-id';
|
||||||
import { EntityService } from '@core/http/entity.service';
|
import { EntityService } from '@core/http/entity.service';
|
||||||
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
||||||
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
|
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
|
||||||
import { Authority } from '@shared/models/authority.enum';
|
import { Authority } from '@shared/models/authority.enum';
|
||||||
import { isEqual } from '@core/utils';
|
import { isEqual } from '@core/utils';
|
||||||
|
import {coerceBoolean} from '@shared/decorators/coerce-boolean';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-entity-autocomplete',
|
selector: 'tb-entity-autocomplete',
|
||||||
@ -71,8 +71,6 @@ export class EntityAutocompleteComponent implements ControlValueAccessor, OnInit
|
|||||||
|
|
||||||
searchText = '';
|
searchText = '';
|
||||||
|
|
||||||
private requiredValue: boolean;
|
|
||||||
|
|
||||||
private dirty = false;
|
private dirty = false;
|
||||||
|
|
||||||
private refresh$ = new Subject<Array<BaseData<EntityId>>>();
|
private refresh$ = new Subject<Array<BaseData<EntityId>>>();
|
||||||
@ -119,14 +117,11 @@ export class EntityAutocompleteComponent implements ControlValueAccessor, OnInit
|
|||||||
appearance: MatFormFieldAppearance = 'fill';
|
appearance: MatFormFieldAppearance = 'fill';
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
set required(value: boolean) {
|
@coerceBoolean()
|
||||||
this.requiredValue = coerceBooleanProperty(value);
|
required: boolean;
|
||||||
}
|
|
||||||
get required(): boolean {
|
|
||||||
return this.requiredValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
|
@coerceBoolean()
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user