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
RevLine 
[ceaed42]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';
[e29cc2e]5import { DynamicDialogRef } from 'primeng/dynamicdialog';
[8d391a1]6import { LocationService } from 'src/app/_services/location.service';
7import { Location } from 'src/app/_models/location';
8import { PlannerLocationDto } from 'src/app/_models/dto/plannerLocationDto';
[e29cc2e]9
[ceaed42]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[];
[8d391a1]19
[e29cc2e]20 constructor(private plannerService: PlannerService,
[8d391a1]21 private route: ActivatedRoute, private ref: DynamicDialogRef, private locationService : LocationService) {
[ceaed42]22 this.planners = [];
23 }
24
25 ngOnInit(): void {
[e29cc2e]26
[ceaed42]27 this.plannerService.getAllPlanners().subscribe(
[e29cc2e]28 planner => {
29 this.planners = planner;
[ceaed42]30 }
31 );
[8d391a1]32
[ceaed42]33 }
34
[e29cc2e]35 selectPlanner(planner: Planner) {
36 this.ref.close(planner);
[ceaed42]37 }
38
39}
Note: See TracBrowser for help on using the repository browser.