Home > Mobile >  Property 'submit' does not exist on type 'SingupComponent'
Property 'submit' does not exist on type 'SingupComponent'

Time:10-29

I'm starting my studies with Angular and I don't understand how to solve this:

Compiled with problems:X

ERROR

src/app/singup/singup.component.html:14:50 - error TS2339: Property 'submit' does not exist on type 'SingupComponent'.

14       <form [formGroup]="singUpForm" (ngSubmit)="submit()">
                                                    ~~~~~~

  src/app/singup/singup.component.ts:21:16
    21   templateUrl: './singup.component.html',
                      ~~~~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component SingupComponent.

enter image description here

If anyone knows how to solve it and can share...

CodePudding user response:

This errors means that you didn't create the method in your component class. Make sure you have, and that your file are saved (screenshot shows unsaved file)

@Component({...})
export class SignupComponent {
    ...

    submit() {}

    ...
}
  • Related