- Timestamp:
- 12/28/21 08:56:55 (3 years ago)
- Branches:
- master
- Children:
- b738035
- Parents:
- 84d0fbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/homepage/register/register.component.ts
r84d0fbb rbdd6491 1 1 import { Component, OnInit } from '@angular/core'; 2 import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 2 3 import { DynamicDialogRef } from 'primeng/dynamicdialog'; 3 4 import { UserDto } from 'src/app/_models/dto/userDto'; … … 10 11 export class RegisterComponent implements OnInit { 11 12 12 user : UserDto; 13 user: UserDto; 14 myForm: FormGroup; 13 15 14 constructor(private ref: DynamicDialogRef ) {16 constructor(private ref: DynamicDialogRef, private fb: FormBuilder) { 15 17 this.user = new UserDto(); 16 } 18 this.myForm = fb.group({ 19 title: fb.control('initial value', Validators.required) 20 }); 21 } 17 22 18 23 ngOnInit(): void { 24 this.myForm = this.fb.group({ 25 fullName: this.fb.control('', Validators.required), 26 username: this.fb.control('', Validators.required), 27 password: this.fb.control('', Validators.required), 28 confirmPassword: this.fb.control('', Validators.required) 29 }); 19 30 } 20 21 onFormSubmitSignUp(user) {31 32 onFormSubmitSignUp(user) { 22 33 this.ref.close(user); 23 34 //window.location.reload(); 35 24 36 } 37 25 38 }
Note:
See TracChangeset
for help on using the changeset viewer.