source: trip-planner-front/src/app/homepage/register/register.component.ts@ bdd6491

Last change on this file since bdd6491 was bdd6491, checked in by Ema <ema_spirova@…>, 3 years ago

pre final presentation

  • Property mode set to 100644
File size: 1.0 KB
Line 
1import { Component, OnInit } from '@angular/core';
2import { FormBuilder, FormGroup, Validators } from '@angular/forms';
3import { DynamicDialogRef } from 'primeng/dynamicdialog';
4import { UserDto } from 'src/app/_models/dto/userDto';
5
6@Component({
7 selector: 'app-register',
8 templateUrl: './register.component.html',
9 styleUrls: ['./register.component.css']
10})
11export class RegisterComponent implements OnInit {
12
13 user: UserDto;
14 myForm: FormGroup;
15
16 constructor(private ref: DynamicDialogRef, private fb: FormBuilder) {
17 this.user = new UserDto();
18 this.myForm = fb.group({
19 title: fb.control('initial value', Validators.required)
20 });
21 }
22
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 });
30 }
31
32 onFormSubmitSignUp(user) {
33 this.ref.close(user);
34 //window.location.reload();
35
36 }
37
38}
Note: See TracBrowser for help on using the repository browser.