Angular 2 Form Validation Error “Unhandled Promise rejection: Cannot assign to a reference or variable!”

前端 未结 6 1039
面向向阳花
面向向阳花 2020-12-11 15:22

App.component.html



        
6条回答
  •  借酒劲吻你
    2020-12-11 15:47

    You should either change your component variable, or your template #name variable. They are colliding:

    export class AppComponent {
      prettyname: string; // here
      username: string;
      email: string;
      password: string;
    }
    

    Also change your String to string

    Name is required
    Name must be at least 4 characters long
    Name cannot be more than 20 characters long

提交回复
热议问题