Changeset e29cc2e for trip-planner-front/src/app/location/location-details
- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- Location:
- trip-planner-front/src/app/location/location-details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/location/location-details/location-details.component.html
r59329aa re29cc2e 7 7 <div class="card"> 8 8 <h5>More photos</h5> 9 <p-galleria [value]="images" [responsiveOptions]="responsiveOptions" [containerStyle]="{'max-width': '640px'}" [numVisible]="5"10 [ circular]="true" [showItemNavigators]="true">9 <p-galleria [value]="images" [responsiveOptions]="responsiveOptions" [containerStyle]="{'max-width': '640px'}" 10 [numVisible]="5" [circular]="true" [showItemNavigators]="true"> 11 11 <ng-template pTemplate="item" let-image> 12 <img src="data:image/png;base64,{{image.content}}" style="width: 100%; height: 350px; display: block;" /> 12 <img src="data:image/png;base64,{{image.content}}" 13 style="width: 100%; height: 350px; display: block;" /> 13 14 </ng-template> 14 15 <ng-template pTemplate="thumbnail" let-image> 15 16 <div class="p-grid p-nogutter p-justify-center"> 16 <img src="data:image/png;base64,{{image.content}}" style="width: 50px; height:50px; display: block;" /> 17 <img src="data:image/png;base64,{{image.content}}" 18 style=" height:50px; display: block;" /> 17 19 </div> 18 20 </ng-template> 19 21 </p-galleria> 20 22 </div> 23 -
trip-planner-front/src/app/location/location-details/location-details.component.ts
r59329aa re29cc2e 1 import { Component, OnInit , ViewEncapsulation} from '@angular/core';1 import { Component, OnInit, ViewEncapsulation } from '@angular/core'; 2 2 import { ActivatedRoute, Router } from '@angular/router'; 3 3 import { Images } from 'src/app/_models/images'; … … 16 16 locationDetails: Location; 17 17 images: Images[]; 18 responsiveOptions;19 18 20 constructor(private route: ActivatedRoute, private router: Router, private locationService 21 private imagesService: ImagesService) {19 constructor(private route: ActivatedRoute, private router: Router, private locationService: LocationService, 20 private imagesService: ImagesService) { 22 21 this.locationId = 1; 23 22 this.locationDetails = new Location(); 24 23 this.images = []; 24 } 25 25 26 this.responsiveOptions= [27 26 responsiveOptions:any[] = [ 27 { 28 28 breakpoint: '1024px', 29 29 numVisible: 5 … … 37 37 numVisible: 1 38 38 } 39 ]; 40 } 41 42 39 ]; 43 40 ngOnInit(): void { 44 41 this.route.queryParams 45 .subscribe(params => {46 this.locationId = params.id;47 });42 .subscribe(params => { 43 this.locationId = params.id; 44 }); 48 45 49 46 this.locationService.getLocation(this.locationId).subscribe( 50 47 data => { 51 48 this.locationDetails = data; 52 49 } 53 50 ); 54 51 55 52 this.imagesService.getAllImagesForLocation(this.locationId).subscribe( 56 53 image => { 57 54 this.images = image; 58 55 } 59 );56 ); 60 57 } 61 58 62 59 63 60 }
Note:
See TracChangeset
for help on using the changeset viewer.