Ignore:
Timestamp:
12/28/21 08:56:55 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
b738035
Parents:
84d0fbb
Message:

pre final presentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/src/app/homepage/register/register.component.ts

    r84d0fbb rbdd6491  
    11import { Component, OnInit } from '@angular/core';
     2import { FormBuilder, FormGroup, Validators } from '@angular/forms';
    23import { DynamicDialogRef } from 'primeng/dynamicdialog';
    34import { UserDto } from 'src/app/_models/dto/userDto';
     
    1011export class RegisterComponent implements OnInit {
    1112
    12   user : UserDto;
     13  user: UserDto;
     14  myForm: FormGroup;
    1315
    14   constructor(private ref: DynamicDialogRef) {
     16  constructor(private ref: DynamicDialogRef, private fb: FormBuilder) {
    1517    this.user = new UserDto();
    16    }
     18    this.myForm = fb.group({
     19      title: fb.control('initial value', Validators.required)
     20    });
     21  }
    1722
    1823  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    });
    1930  }
    20  
    21   onFormSubmitSignUp(user){
     31
     32  onFormSubmitSignUp(user) {
    2233    this.ref.close(user);
    2334    //window.location.reload();
     35
    2436  }
     37
    2538}
Note: See TracChangeset for help on using the changeset viewer.