Changeset 59329aa for trip-planner-front/src/app/location
- Timestamp:
- 11/23/21 14:58:44 (3 years ago)
- Branches:
- master
- Children:
- e29cc2e
- Parents:
- ceaed42
- Location:
- trip-planner-front/src/app/location
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/location/add-location-to-planner-panel/add-location-to-planner-panel.component.html
rceaed42 r59329aa 13 13 </form> 14 14 15 <button mat-button (click)="onCancelClick()">Cancel</button>15 <button type="button" mat-button (click)="onCancelClick()">Cancel</button> -
trip-planner-front/src/app/location/add-location-to-planner-panel/add-location-to-planner-panel.component.ts
rceaed42 r59329aa 1 1 import { Component, OnInit } from '@angular/core'; 2 import { NgForm } from '@angular/forms';3 2 import { MatDialogRef } from '@angular/material/dialog'; 4 3 import { ActivatedRoute } from '@angular/router'; … … 21 20 locationId: number; 22 21 plannerLocationDto: PlannerLocationDto; 22 locationsInPlanner: Location[]; 23 23 24 24 25 constructor(private dialogRef: MatDialogRef<AddLocationToPlannerPanelComponent>, private plannerService: PlannerService, … … 29 30 this.locationId = 1; 30 31 this.plannerLocationDto = new PlannerLocationDto(); 32 this.locationsInPlanner = []; 31 33 } 32 34 … … 56 58 this.plannerLocationDto.locationId = this.locationId; 57 59 this.plannerLocationDto.plannerId = plannerId; 60 /* 58 61 this.locationService.postLocationToPlanner(this.plannerLocationDto).subscribe( 59 62 data => { … … 61 64 } 62 65 ); 63 } 66 */ 67 68 // window.location.reload(); 69 } 64 70 65 71 } -
trip-planner-front/src/app/location/location.component.html
rceaed42 r59329aa 18 18 <td>{{location.name}}</td> 19 19 <td><button mat-raised-button color="primary" (click)="openDialogSave(location.id)">Add to my planner</button></td> 20 <td><button mat-raised-button color="primary" >See details</button></td>20 <td><button mat-raised-button color="primary" (click)="onClickSeeDetails(location.id)">See details</button></td> 21 21 </tr> 22 22 </tbody> -
trip-planner-front/src/app/location/location.component.ts
rceaed42 r59329aa 1 import { Route } from '@angular/compiler/src/core';2 1 import { Component, Input, OnInit, Output } from '@angular/core'; 3 2 import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 4 3 import { MatDialog } from '@angular/material/dialog'; 5 4 import { ActivatedRoute, Router } from '@angular/router'; 6 import { Location } from '../_models/location';7 5 import { LocationService } from '../_services/location.service'; 8 6 import { AddLocationToPlannerPanelComponent } from './add-location-to-planner-panel/add-location-to-planner-panel.component'; … … 24 22 regionOption: boolean = false; 25 23 regionId: number; 24 locationId: number; 26 25 27 26 constructor(private fb: FormBuilder, private route: ActivatedRoute, private locationService: LocationService, … … 36 35 this.listLocations = []; 37 36 this.regionId = 1; 37 this.locationId = 1; 38 38 } 39 39 … … 71 71 } 72 72 73 openDialogSave(locationId : number){74 console.log(locationId);73 openDialogSave(locationId){ 74 // console.log(locationId); 75 75 const dialogRef = this.dialog.open(AddLocationToPlannerPanelComponent, { 76 76 width: '250px', 77 77 data: {} 78 78 }); 79 this.router.navigate(['locations'], {queryParams: {locationId: locationId}}); 79 this.router.navigate(['locations'], {queryParams: {regionId: this.regionId, companionId: this.companionId, lengthOfStay: this.lengthOfStay, categoryIds: this.categoryIds, locationId: locationId}}); 80 80 81 } 81 82 83 onClickSeeDetails(id: number){ 84 this.router.navigate(['location'], {queryParams: {id: id}}); 85 } 82 86 }
Note:
See TracChangeset
for help on using the changeset viewer.