Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

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  
    77    <div class="card">
    88        <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">
    1111            <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;" />
    1314            </ng-template>
    1415            <ng-template pTemplate="thumbnail" let-image>
    1516                <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;" />
    1719                </div>
    1820            </ng-template>
    1921        </p-galleria>
    2022    </div>
     23
  • trip-planner-front/src/app/location/location-details/location-details.component.ts

    r59329aa re29cc2e  
    1 import { Component, OnInit , ViewEncapsulation} from '@angular/core';
     1import { Component, OnInit, ViewEncapsulation } from '@angular/core';
    22import { ActivatedRoute, Router } from '@angular/router';
    33import { Images } from 'src/app/_models/images';
     
    1616  locationDetails: Location;
    1717  images: Images[];
    18   responsiveOptions;
    1918
    20   constructor(private route: ActivatedRoute, private router: Router, private locationService : LocationService,
    21               private imagesService : ImagesService) {
     19  constructor(private route: ActivatedRoute, private router: Router, private locationService: LocationService,
     20    private imagesService: ImagesService) {
    2221    this.locationId = 1;
    2322    this.locationDetails = new Location();
    2423    this.images = [];
     24  }
    2525
    26     this.responsiveOptions = [
    27       {
     26  responsiveOptions:any[] = [
     27    {
    2828        breakpoint: '1024px',
    2929        numVisible: 5
     
    3737        numVisible: 1
    3838    }
    39   ];
    40    }
    41 
    42 
     39];
    4340  ngOnInit(): void {
    4441    this.route.queryParams
    45     .subscribe(params => {     
    46       this.locationId = params.id;
    47     });
     42      .subscribe(params => {
     43        this.locationId = params.id;
     44      });
    4845
    4946    this.locationService.getLocation(this.locationId).subscribe(
    5047      data => {
    51           this.locationDetails = data;
     48        this.locationDetails = data;
    5249      }
    5350    );
    54    
     51
    5552    this.imagesService.getAllImagesForLocation(this.locationId).subscribe(
    5653      image => {
    57          this.images = image;
     54        this.images = image;
    5855      }
    59    );
     56    );
    6057  }
    6158
    62  
     59
    6360}
Note: See TracChangeset for help on using the changeset viewer.