0

I am using the below functions to save my form. .ts file

  saveScheduleCheckin(addcheckinform: NgForm) {
    this.scheduleCheckInService.saveScheduleCheckIn(this.checkin).subscribe(data => {
      this.alertService.success('success');
      addcheckinform.reset();
    },
      error => {
        this.errorMsg = error.statusText;
      });
  }

Service file

  saveScheduleCheckIn(checkin: Object): Observable<any> {
    console.log(checkin);
    return this.http.post(`${this.url}`, checkin).pipe(catchError(this.errorHandler));
  }

currently, this is working and I console the data. check below image enter image description here

What is that 'prototype' object (marked blue color)? is it error? this form submission is wrong? please help me

IAfanasov
  • 4,775
  • 3
  • 27
  • 42
Kumara
  • 471
  • 2
  • 10
  • 33
  • Does this answer your question? [How does JavaScript .prototype work?](https://stackoverflow.com/questions/572897/how-does-javascript-prototype-work) – Satpal Aug 13 '21 at 07:12

1 Answers1

0

Everything looking fine. as per this you have created & declared

checkin variable as a CheckInModel model right

public checkin: CheckInModel;

Like above. so when you passing it to service it's printing model name as prototype