source: trip-planner-front/src/app/location/add-location-to-planner-panel/add-location-to-planner-panel.component.ts@ 8d391a1

Last change on this file since 8d391a1 was 8d391a1, checked in by Ema <ema_spirova@…>, 3 years ago

disabling to add location if it already exists in the planner

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import { Component, OnInit } from '@angular/core';
2import { ActivatedRoute } from '@angular/router';
3import { Planner } from 'src/app/_models/planner';
4import { PlannerService } from 'src/app/_services/planner.service';
5import { DynamicDialogRef } from 'primeng/dynamicdialog';
6import { LocationService } from 'src/app/_services/location.service';
7import { Location } from 'src/app/_models/location';
8import { PlannerLocationDto } from 'src/app/_models/dto/plannerLocationDto';
9
10
11@Component({
12 selector: 'app-add-location-to-planner-panel',
13 templateUrl: './add-location-to-planner-panel.component.html',
14 styleUrls: ['./add-location-to-planner-panel.component.css']
15})
16export class AddLocationToPlannerPanelComponent implements OnInit {
17
18 planners: Planner[];
19
20 constructor(private plannerService: PlannerService,
21 private route: ActivatedRoute, private ref: DynamicDialogRef, private locationService : LocationService) {
22 this.planners = [];
23 }
24
25 ngOnInit(): void {
26
27 this.plannerService.getAllPlanners().subscribe(
28 planner => {
29 this.planners = planner;
30 }
31 );
32
33 }
34
35 selectPlanner(planner: Planner) {
36 this.ref.close(planner);
37 }
38
39}
Note: See TracBrowser for help on using the repository browser.