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