How to get past data without using manual data entering using angular form

I am developing a summarized score card web application.I want to add past data of players.What is the better method to do it.Can I use csv file or xml file ?How to use it?My Angular manual form and spring model given beleow.where should I put csv file(back-end or front-end) ?

Angular form

<                   <div *ngIf="errorMessage" class="alert alert-danger">                     <button (click)="close()" type="button" aria-hidden="true" class="close">                       <i class="now-ui-icons ui-1_simple-remove"></i>                     </button>                     <span>                       {{ errorMessage }}                     </span>                   </div>                    <form [formGroup]="playerRegisterForm" (ngSubmit)="playerFormSubmit()">                     <div class="row">                        <div class="col-sm-12 col-lg-6">                         <div class="form-group">                           <input                             [class.is-invalid]="playerRegisterForm.get('userName').invalid && playerRegisterForm.get('userName').touched"                             formControlName="userName" type="text" name="userName" placeholder="User Name"                             class="form-control" />                           <div                             *ngIf="playerRegisterForm.get('userName').invalid &&  playerRegisterForm.get('userName').touched">                             <small *ngIf="userNameField.errors?.required" class="text-danger">User Name Required</small>                           </div>                         </div>                       </div>                         <div class="col-sm-12 col-lg-6">                         <div class="form-group">                           <input                             [class.is-invalid]="playerRegisterForm.get('nameWithInitial').invalid && playerRegisterForm.get('nameWithInitial').touched"                             formControlName="nameWithInitial" type="text" name="userInitialName"                             placeholder="Name With Initial" class="form-control" />                           <div                             *ngIf="playerRegisterForm.get('nameWithInitial').invalid &&  playerRegisterForm.get('nameWithInitial').touched">                             <small *ngIf="nameWithInitialField.errors?.required" class="text-danger">Name With Initial                               Required</small>                           </div>                         </div>                       </div>                        <div class="col-sm-12 col-lg-12">                         <div class="form-group">                           <input                             [class.is-invalid]="playerRegisterForm.get('fullName').invalid && playerRegisterForm.get('fullName').touched"                             formControlName="fullName" type="text" name="fullName" placeholder="Full Name"                             class="form-control" />                           <div                             *ngIf="playerRegisterForm.get('fullName').invalid &&  playerRegisterForm.get('fullName').touched">                             <small *ngIf="fullNameField.errors?.required" class="text-danger">Full Name                               Required</small>                           </div>                         </div>                       </div>                        <div class="col-sm-12 col-lg-6">                         <div class="form-group">                           <input                             [class.is-invalid]="playerRegisterForm.get('nic').invalid && playerRegisterForm.get('nic').touched"                             formControlName="nic" type="text" name="NIC" placeholder="NIC Number"                             class="form-control" />                           <div *ngIf="playerRegisterForm.get('nic').invalid &&  playerRegisterForm.get('nic').touched">                             <small *ngIf="nicField.errors?.required" class="text-danger">NIC Number Required</small>                             <small *ngIf="nicField.errors?.pattern" class="text-danger">Insert Valid NIC Number</small>                           </div>                         </div>                       </div>                        <div class="col-sm-12 col-lg-6">                         <div class="form-group">                           <input                             [class.is-invalid]="playerRegisterForm.get('contactNumber').invalid && playerRegisterForm.get('contactNumber').touched"                             formControlName="contactNumber" type="text" name="contactNumber"                             placeholder="Contact Number" class="form-control" />                           <div                             *ngIf="playerRegisterForm.get('contactNumber').invalid &&  playerRegisterForm.get('contactNumber').touched">                             <small *ngIf="contactNumberField.errors?.required" class="text-danger">Contact Number                               Required</small>                             <small *ngIf="contactNumberField.errors?.pattern" class="text-danger">Insert Valid Contact                               Number</small>                           </div>                         </div>                       </div>                        <div class="col-sm-12 col-lg-12">                         <div class="form-group">                           <input                             [class.is-invalid]="playerRegisterForm.get('address').invalid && playerRegisterForm.get('address').touched"                             formControlName="address" type="text" name="address" placeholder="Address"                             class="form-control" />                           <div                             *ngIf="playerRegisterForm.get('address').invalid &&  playerRegisterForm.get('address').touched">                             <small *ngIf="addressField.errors?.required" class="text-danger">Address                               Required</small>                           </div>                         </div>                       </div>                        <div class="col-sm-12 col-lg-6">                         <div class="form-group">                           <input                             [class.is-invalid]="playerRegisterForm.get('email').invalid && playerRegisterForm.get('email').touched"                             formControlName="email" type="text" name="email" placeholder="Email" class="form-control" />                           <div                             *ngIf="playerRegisterForm.get('email').invalid &&  playerRegisterForm.get('email').touched">                             <small *ngIf="emailField.errors?.required" class="text-danger">Email Address                               Required</small>                             <small *ngIf="emailField.errors?.email" class="text-danger">Insert valid                               email</small>                           </div>                         </div>                       </div>    

spring model

@Entity @Table(name = "player") public class Player {      @Id     @GeneratedValue(strategy = GenerationType.IDENTITY)     private Integer playerId;      /*      * 1 : Batman, 2 : Baller, 3 : AllRounder      */     @NotBlank     private String specialType;      @NotNull     @OneToOne     @JoinColumn(name = "user_id", referencedColumnName = "user_id")     private User userId;      @NotNull     @ManyToOne     @JoinColumn(name = "baller_type_id", referencedColumnName = "baller_type_id")     private BallerType ballerTypeId;      @NotNull     @ManyToOne     @JoinColumn(name = "batman_type_id", referencedColumnName = "batman_type_id")     private BatmanType batmanTypeId;      @NotNull     @ManyToOne     @JoinColumn(name = "club_id", referencedColumnName = "club_id")     private Club clubId;      public Player() {     }      public Player(Integer playerId, @NotNull String specialType, @NotNull User userId,             @NotNull BallerType ballerTypeId, @NotNull BatmanType batmanTypeId, @NotNull Club clubId) {         super();         this.playerId = playerId;         this.specialType = specialType;         this.userId = userId;         this.ballerTypeId = ballerTypeId;         this.batmanTypeId = batmanTypeId;         this.clubId = clubId;     }           @Override     public String toString() {         return "Player [playerId=" + playerId + ", specialType=" + specialType + ", userId=" + userId                 + ", ballerTypeId=" + ballerTypeId + ", batmanTypeId=" + batmanTypeId + ", clubId=" + clubId + "]";     }  
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.