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
|
Rev | Line | |
---|
[ceaed42] | 1 | import { Component, OnInit } from '@angular/core';
|
---|
| 2 | import { ActivatedRoute } from '@angular/router';
|
---|
| 3 | import { Planner } from 'src/app/_models/planner';
|
---|
| 4 | import { PlannerService } from 'src/app/_services/planner.service';
|
---|
[e29cc2e] | 5 | import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
---|
[8d391a1] | 6 | import { LocationService } from 'src/app/_services/location.service';
|
---|
| 7 | import { Location } from 'src/app/_models/location';
|
---|
| 8 | import { 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 | })
|
---|
| 16 | export 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.