Created
July 21, 2024 18:49
-
-
Save rakia/4305cc1fb23a748ef9d7104a09a952b2 to your computer and use it in GitHub Desktop.
Angular: Logic to show real-time feedback to users when they type a name that already exists in the system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ng-container *ngIf="isCreateMode"> | |
<div class="mt-0"> | |
<app-create-custom-field | |
[ecsFieldset]="entity.id!" | |
[nameAlreadyExists]="nameAlreadyExists" | |
(checkIfNameExists)="checkIfNameExists.emit($event)" | |
(cancelEdit)="cancelEdit.emit()" | |
(save)="createCustomField.emit($event)" | |
> | |
</app-create-custom-field> | |
</div> | |
</ng-container> | |
<ng-container *ngIf="!openAllFields && selectedEcsField?.id"> | |
<div class="mt-2"> | |
<app-ecs-field | |
[entity]="selectedEcsField!" | |
[nameAlreadyExists]="nameAlreadyExists" | |
(checkIfNameExists)="checkIfNameExists.emit($event)" | |
(cancelEdit)="cancelEdit.emit()" | |
(delete)="deleteEcsField.emit($event)" | |
> | |
</app-ecs-field> | |
</div> | |
</ng-container> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment