- Timestamp:
- 11/04/21 23:10:39 (3 years ago)
- Branches:
- master
- Children:
- ceaed42
- Parents:
- 6a80231
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/planner/planner.component.ts
r6a80231 r6c1585f 5 5 import { CreateInitialPlannerComponent } from '../create-initial-planner/create-initial-planner.component'; 6 6 import { Router } from '@angular/router'; 7 import { PlannerDto } from '../_models/dto/plannerDto'; 8 import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 7 9 8 10 … … 15 17 16 18 planners: Planner[]; 17 plannerId: number; 19 plannerDto: PlannerDto; 20 editForm: FormGroup; 18 21 19 constructor(private plannerService: PlannerService, public dialog: MatDialog, private router: Router) { 22 23 24 constructor(private plannerService: PlannerService, public dialog: MatDialog, private router: Router, 25 private fb : FormBuilder) { 20 26 this.planners = []; 21 this.plannerId = 1; 27 this.plannerDto = new PlannerDto(); 28 this.editForm = fb.group({ 29 title: fb.control('initial value', Validators.required) 30 }); 22 31 }; 23 32 … … 37 46 } 38 47 39 onClickEditPlanner (id: number){48 onClickEditPlannerGet(id: number){ 40 49 console.log(id); 41 42 43 this.router.navigate(['edit/planner/', this.plannerId]) 50 this.plannerService.getPlannerById(id).subscribe( 51 data => { 52 53 this.router.navigate(['edit/planner/', id]) 54 } 55 ); 44 56 45 57 } 58 59 46 60 }
Note:
See TracChangeset
for help on using the changeset viewer.