backend: microservices-oriented architecture, clean-architecture design pattern, spring-boot, spring cloud gateway, spring cloud eureka et spring cloud config. - frontend: angular, observer rxjs

sub-compo-employee-update.component.html 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <div class="container mt-2" *ngIf="employeeForm">
  2. <div class="card">
  3. <div class="card-header">Employee infos</div>
  4. <div class="card-body">
  5. <form
  6. [formGroup]="employeeForm"
  7. (ngSubmit)="onSaveEmployeeFormData(); employeeForm.reset()"
  8. >
  9. <label for="firstname">firstname</label>
  10. <input
  11. type="text"
  12. class="form-control"
  13. formControlName="firstname"
  14. [ngClass]="{
  15. 'is-invalid':
  16. employeeForm.controls['firstname'].touched &&
  17. employeeForm.controls['firstname'].invalid
  18. }"
  19. />
  20. <div class="invalid-feedback">
  21. <span *ngIf="employeeForm.controls['firstname'].errors?.['required']">
  22. firstname is required</span
  23. >
  24. </div>
  25. <label for="lastname">lastname</label>
  26. <input
  27. type="text"
  28. class="form-control"
  29. formControlName="lastname"
  30. [ngClass]="{
  31. 'is-invalid':
  32. employeeForm.controls['lastname'].touched &&
  33. employeeForm.controls['lastname'].invalid
  34. }"
  35. />
  36. <div class="invalid-feedback">
  37. <span *ngIf="employeeForm.controls['lastname'].errors?.['required']"
  38. >lastname is required</span
  39. >
  40. </div>
  41. <label for="employeeState">Employee state </label>
  42. <select formControlName="employeeState" class="form-control">
  43. <option
  44. *ngFor="let state of employeeState | keyvalue"
  45. [ngValue]="state.value"
  46. >
  47. {{ state.value }}
  48. </option>
  49. </select>
  50. <div class="invalid-feedback">
  51. <span
  52. *ngIf="employeeForm.controls['employeeState'].errors?.['required']"
  53. >state is required</span
  54. >
  55. </div>
  56. <label for="employeeType">Employee type </label>
  57. <select formControlName="employeeType" class="form-control">
  58. <option
  59. *ngFor="let type of employeeType | keyvalue"
  60. [ngValue]="type.value"
  61. >
  62. {{ type.value }}
  63. </option>
  64. </select>
  65. <div class="invalid-feedback">
  66. <span
  67. *ngIf="employeeForm.controls['employeeType'].errors?.['required']"
  68. >type is required</span
  69. >
  70. </div>
  71. <label for="addressID">Address ID for the employee</label>
  72. <select class="form-control" formControlName="addressID">
  73. <option
  74. *ngFor="let addressMap of addressesMap | keyvalue" [ngValue]="addressMap.key"
  75. >
  76. {{addressMap.value}}
  77. </option>
  78. </select>
  79. <div class="invalid-feedback">
  80. <span *ngIf="employeeForm.controls['addressID'].errors?.['required']"
  81. >address is required</span
  82. >
  83. </div>
  84. <div class="text-center mt-2">
  85. <button
  86. type="submit"
  87. class="btn btn-outline-primary"
  88. [disabled]="employeeForm.invalid"
  89. >
  90. save
  91. </button>
  92. </div>
  93. </form>
  94. </div>
  95. </div>
  96. </div>

Powered by TurnKey Linux.