Changeset 1ad8e64 for trip-planner-front/src/app/planner
- Timestamp:
- 11/29/21 22:35:07 (3 years ago)
- Branches:
- master
- Children:
- 84d0fbb
- Parents:
- 8d391a1
- Location:
- trip-planner-front/src/app/planner
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/planner/edit-planner/edit-planner.component.html
r8d391a1 r1ad8e64 43 43 </div> 44 44 <button pButton pRipplelabel label="Save" class="p-button-help"></button> 45 <button pButton pRipple label="Back" class="p-button-info" (click)="onClickBack()" [style]="{'margin-left': '.5em'}"></button>46 47 45 </form> 48 46 <button pButton pRipple label="Back" class="p-button-info" (click)="onClickBack()" [style]="{'margin-left': '.11em'}"></button> -
trip-planner-front/src/app/planner/edit-planner/edit-planner.component.ts
r8d391a1 r1ad8e64 78 78 79 79 onClickBack(){ 80 console.log("promena");81 80 this.router.navigate(['planners']); 82 81 } -
trip-planner-front/src/app/planner/planner.component.html
r8d391a1 r1ad8e64 1 1 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> 2 2 3 3 <p-toast></p-toast> 4 4 <button pButton pRipple type="button" label="Create initial planner" class="p-button-help " (click)="show()"></button> 5 5 <br> -
trip-planner-front/src/app/planner/planner.component.ts
r8d391a1 r1ad8e64 5 5 import { Router } from '@angular/router'; 6 6 import { PlannerDto } from '../_models/dto/plannerDto'; 7 import { FormBuilder, FormGroup, Validators } from '@angular/forms';8 7 import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog'; 9 import { PrimeNGConfig } from 'primeng/api';8 import { MessageService, PrimeNGConfig } from 'primeng/api'; 10 9 11 10 … … 13 12 selector: 'app-planner', 14 13 templateUrl: './planner.component.html', 15 styleUrls: ['./planner.component.css'] 14 styleUrls: ['./planner.component.css'], 15 providers: [DialogService, MessageService] 16 16 }) 17 17 export class PlannerComponent implements OnInit { … … 19 19 planners: Planner[]; 20 20 plannerDto: PlannerDto; 21 editForm: FormGroup;22 21 ref: DynamicDialogRef; 23 22 24 23 25 24 constructor(private plannerService: PlannerService, private router: Router, 26 private fb: FormBuilder, private dialogService: DialogService, private primengConfig: PrimeNGConfig) {25 private dialogService: DialogService, private primengConfig: PrimeNGConfig, private messageService: MessageService) { 27 26 this.planners = []; 28 27 this.plannerDto = new PlannerDto(); 29 this.editForm = fb.group({ 30 title: fb.control('initial value', Validators.required) 31 }); 32 this.ref = new DynamicDialogRef; 28 this.ref = new DynamicDialogRef; 33 29 } 34 30 … … 51 47 } 52 48 ); 49 } 53 50 54 }55 51 show() { 56 52 this.ref = this.dialogService.open(CreateInitialPlannerComponent, { … … 60 56 baseZIndex: 10000 61 57 }); 58 this.ref.onClose.subscribe((planner: Planner) => { 59 console.log("NOVOKREIRANIOT NAME NA PLANNER: " + planner.name); 60 this.plannerService.postInitialPlanner(planner).subscribe( 61 data=>{ 62 console.log(data); 63 }, 64 error => console.log('oops', error) 65 ); 66 this.messageService.add({ severity: 'success', summary: 'The planner: ' + planner.name + ' has been created.' }); 67 }); 68 62 69 } 70 63 71 }
Note:
See TracChangeset
for help on using the changeset viewer.