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-company-create.component.html 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <div class="container">
  2. <div class="card">
  3. <div class="card-header">Company infos</div>
  4. <div class="card-body">
  5. <form
  6. #companyForm="ngForm"
  7. (ngSubmit)="onCompanyCreate(); companyForm.resetForm()"
  8. >
  9. <label for="companyName">company name</label>
  10. <input
  11. type="text"
  12. class="form-control"
  13. name="companyName"
  14. #companyName="ngModel"
  15. [(ngModel)]="company.companyName"
  16. [ngClass]="{
  17. 'is-invalid': companyName.touched && companyName.invalid
  18. }"
  19. required
  20. minlength="4"
  21. maxlength="20"
  22. />
  23. <div class="invalid-feedback">
  24. <span *ngIf="companyName.errors?.['required']">required</span>
  25. <span *ngIf="companyName.errors?.['minlength']"
  26. >very short company name</span
  27. >
  28. <span *ngIf="companyName.errors?.['maxlength']"
  29. >too long company name</span
  30. >
  31. </div>
  32. <label for="companyType">type of company</label>
  33. <select
  34. class="form-control"
  35. required
  36. name="companyType"
  37. #companyType="ngModel"
  38. [(ngModel)]="company.companyType"
  39. >
  40. <option
  41. *ngFor="let type of companyTypes | keyvalue"
  42. [ngValue]="type.key"
  43. >
  44. {{ type.value }}
  45. </option>
  46. </select>
  47. <div class="invalid-feedback">
  48. <span *ngIf="companyType.errors?.['required']">required</span>
  49. </div>
  50. <label for="agency">agency</label>
  51. <input
  52. type="text"
  53. class="form-control"
  54. name="agency"
  55. #agency="ngModel"
  56. [(ngModel)]="company.agency"
  57. [ngClass]="{
  58. 'is-invalid': agency.touched && agency.invalid
  59. }"
  60. required
  61. />
  62. <div class="invalid-feedback">
  63. <span *ngIf="agency.errors?.['required']"> required</span>
  64. </div>
  65. <div class="text-center mt-2">
  66. <button
  67. type="submit"
  68. class="btn btn-outline-primary"
  69. [disabled]="companyForm.invalid"
  70. >
  71. save
  72. </button>
  73. </div>
  74. </form>
  75. </div>
  76. </div>
  77. </div>

Powered by TurnKey Linux.