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

Location:
trip-planner-front/src/app/homepage/register
Files:
2 edited

Legend:

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

    r84d0fbb rbdd6491  
     1<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"
     2    integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
    13
    2     <div class="p-grid p-fluid">
    3         <div class="p-col-12 p-md-4">
    4             <div class="p-inputgroup">
    5                 <span class="p-inputgroup-addon"><i class="pi pi-user"></i></span>
    6                 <input type="text" pInputText placeholder="Full name" [(ngModel)]="user.fullName" name="fullName"
    7             >         
    8             </div>
     4<div class="p-grid p-fluid">
     5    <div class="p-col-12 p-md-4">
     6        <div class="p-inputgroup">
     7            <span class="p-inputgroup-addon"><i class="pi pi-user"></i></span>
     8            <input type="text" pInputText placeholder="Full name" [(ngModel)]="user.fullName" name="fullName"
     9                class="form-control">
     10
    911        </div>
    10    
    11         <div class="p-col-12 p-md-4">
    12             <div class="p-inputgroup">
    13                 <span class="p-inputgroup-addon"><i class="pi pi-user"></i></span>
    14                 <input type="text" pInputText placeholder="Email address (Username)" [(ngModel)]="user.username" name="username"
    15               >         
    16             </div>
     12    </div>
     13
     14    <div class="p-col-12 p-md-4">
     15        <div class="p-inputgroup">
     16            <span class="p-inputgroup-addon"><i class="pi pi-user"></i></span>
     17            <input type="text" pInputText placeholder="Email address (Username)" [(ngModel)]="user.username"
     18                name="username">
    1719        </div>
    18         <div class="p-col-12 p-md-4">
    19             <div class="p-inputgroup">
    20                 <span class="p-inputgroup-addon"><i class="pi pi-password"></i></span>
    21                 <input type="password" pInputText placeholder="Password" [(ngModel)]="user.password" name="password"
    22                 >         
    23             </div>
     20    </div>
     21
     22    <div class="p-col-12 p-md-4">
     23        <div class="p-inputgroup">
     24            <span class="p-inputgroup-addon"><i class="pi pi-password"></i></span>
     25            <input type="password" pInputText placeholder="Password" [(ngModel)]="user.password" name="password">
    2426        </div>
    25         <div class="p-col-12 p-md-4">
    26             <div class="p-inputgroup">
    27                 <span class="p-inputgroup-addon"><i class="pi pi-password"></i></span>
    28                 <input type="password" pInputText placeholder="Repeat password" [(ngModel)]="user.confirmPassword" name="confirmPassword"
    29                 >         
    30             </div>
     27    </div>
     28
     29    <div class="p-col-12 p-md-4">
     30        <div class="p-inputgroup">
     31            <span class="p-inputgroup-addon"><i class="pi pi-password"></i></span>
     32            <input type="password" pInputText placeholder="Repeat password" [(ngModel)]="user.confirmPassword"
     33                name="confirmPassword">
    3134        </div>
    32    
    33         <div class="p-col-12 p-md-4">
    34             <button pButton pRipple label="Submit" class="p-button-secondary" type="submit" (click)="onFormSubmitSignUp(user)"></button>
    35         </div>
    36     </div> 
     35    </div>
     36
     37    <div class="p-col-12 p-md-4">
     38        <button pButton pRipple label="Submit" class="p-button-secondary" type="button"
     39            (click)="onFormSubmitSignUp(user)"></button>
     40    </div>
     41</div>
     42
     43
  • 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.