Base solution for your next web application
Open Closed

Create edit-person-modal.component.ts error with the same code from the docmentation #5698


User avatar
0
system15 created

I have an error message with the same code from the aspnet zero documention step by step development guide. The error that I get is :

Expected 4 arguments but got 1.

Does anyone know how to resolve this ? show(personId): void { this.active = true; this._personService.getPersonForEdit(personId).subscribe((result) => { this.person = result; this.modal.show(); }); }

file: edit-person-modal.component.ts link to docs: [https://www.aspnetzero.com/Documents/Developing-Step-By-Step-Angular]


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi **@system15 **

    Could you share the full error message ?

  • User Avatar
    0
    system15 created

    ERROR in src/app/main/phonebook/edit-person-modal.component.ts(34,9): error TS2554: Expected 5 arguments, but got 1.

    Code below: show(personId): void { this.active = true; line: 34 = this._personService.getPersonForEdit(personId).subscribe((result) => { this.person = result; console.log(this.person); this.modal.show(); }); }

  • User Avatar
    0
    ismcagdas created
    Support Team

    Could you also share GetPersonForEdit method and its input GetPersonForEditInput class ? There might be some changes on NSWAG.

  • User Avatar
    0
    alper created
    Support Team

    closing issue as there's no response from the owner.