Last change
on this file since 8d391a1 was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago |
primeNG components
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[e29cc2e] | 1 | import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
---|
[59329aa] | 2 | import { ActivatedRoute, Router } from '@angular/router';
|
---|
| 3 | import { Images } from 'src/app/_models/images';
|
---|
| 4 | import { Location } from 'src/app/_models/location';
|
---|
| 5 | import { ImagesService } from 'src/app/_services/images.service';
|
---|
| 6 | import { LocationService } from 'src/app/_services/location.service';
|
---|
| 7 |
|
---|
| 8 | @Component({
|
---|
| 9 | selector: 'app-location-details',
|
---|
| 10 | templateUrl: './location-details.component.html',
|
---|
| 11 | styleUrls: ['./location-details.component.css']
|
---|
| 12 | })
|
---|
| 13 | export class LocationDetailsComponent implements OnInit {
|
---|
| 14 |
|
---|
| 15 | locationId: number;
|
---|
| 16 | locationDetails: Location;
|
---|
| 17 | images: Images[];
|
---|
| 18 |
|
---|
[e29cc2e] | 19 | constructor(private route: ActivatedRoute, private router: Router, private locationService: LocationService,
|
---|
| 20 | private imagesService: ImagesService) {
|
---|
[59329aa] | 21 | this.locationId = 1;
|
---|
| 22 | this.locationDetails = new Location();
|
---|
| 23 | this.images = [];
|
---|
[e29cc2e] | 24 | }
|
---|
[59329aa] | 25 |
|
---|
[e29cc2e] | 26 | responsiveOptions:any[] = [
|
---|
| 27 | {
|
---|
[59329aa] | 28 | breakpoint: '1024px',
|
---|
| 29 | numVisible: 5
|
---|
| 30 | },
|
---|
| 31 | {
|
---|
| 32 | breakpoint: '768px',
|
---|
| 33 | numVisible: 3
|
---|
| 34 | },
|
---|
| 35 | {
|
---|
| 36 | breakpoint: '560px',
|
---|
| 37 | numVisible: 1
|
---|
| 38 | }
|
---|
[e29cc2e] | 39 | ];
|
---|
[59329aa] | 40 | ngOnInit(): void {
|
---|
| 41 | this.route.queryParams
|
---|
[e29cc2e] | 42 | .subscribe(params => {
|
---|
| 43 | this.locationId = params.id;
|
---|
| 44 | });
|
---|
[59329aa] | 45 |
|
---|
| 46 | this.locationService.getLocation(this.locationId).subscribe(
|
---|
| 47 | data => {
|
---|
[e29cc2e] | 48 | this.locationDetails = data;
|
---|
[59329aa] | 49 | }
|
---|
| 50 | );
|
---|
[e29cc2e] | 51 |
|
---|
[59329aa] | 52 | this.imagesService.getAllImagesForLocation(this.locationId).subscribe(
|
---|
| 53 | image => {
|
---|
[e29cc2e] | 54 | this.images = image;
|
---|
[59329aa] | 55 | }
|
---|
[e29cc2e] | 56 | );
|
---|
[59329aa] | 57 | }
|
---|
| 58 |
|
---|
[e29cc2e] | 59 |
|
---|
[59329aa] | 60 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.