报名表Angular2

Registration form Angular 2

我是angular2的新人,我需要填写报名表。表单字段 are:Firstaname、姓氏、用户名、密码、重复密码,email.Also 需要对字段进行验证,何时在点赞按钮上提交,需要以 json 格式发送 {{username : username, password: password, email: email, firstname: firstname, lastname: lastname}.

如果有人能帮忙,我很乐意看到答案!

for more code check this working demo

this.registrationForm= fb.group({
      email: ['', Validators.compose([Validators.required,  emailValidator])],
      password: ['', Validators.required],
      confirmPassword: ['', Validators.required],
      firstName: ['', Validators.required],
      lastName: ['', Validators.required]
    }, {validator: matchingPasswords('password', 'confirmPassword')})