Changeset bdd6491 for trip-planner-front/src/app/homepage/register
- Timestamp:
- 12/28/21 08:56:55 (3 years ago)
- Branches:
- master
- Children:
- b738035
- Parents:
- 84d0fbb
- 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"> 1 3 2 3 4 5 6 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 9 11 </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"> 17 19 </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"> 24 26 </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"> 31 34 </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 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.