source: trip-planner-front/src/app/homepage/homepage.component.ts@ 1ad8e64

Last change on this file since 1ad8e64 was 1ad8e64, checked in by Ema <ema_spirova@…>, 3 years ago

spring security

  • Property mode set to 100644
File size: 1.9 KB
Line 
1import { Component, OnInit } from '@angular/core';
2import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
3import { Location } from '../_models/location';
4import { LocationService } from '../_services/location.service';
5import { RegisterComponent } from './register/register.component';
6
7
8@Component({
9 selector: 'app-homepage',
10 templateUrl: './homepage.component.html',
11 styleUrls: ['./homepage.component.css']
12})
13export class HomepageComponent implements OnInit {
14
15 imageURI = 'https://i.pinimg.com/736x/a1/1a/57/a11a572a1ec4e07039bbd04661a3b035.jpg';
16 myLogo = 'http://www.logo-designer.co/wp-content/uploads/2020/02/2020-tripadvisor-new-logo-design-by-mother-design-4.png';
17 responsiveOptions;
18 locations: Location[];
19 villages: Location[];
20 ref: DynamicDialogRef;
21
22 constructor(private locationService: LocationService, private dialogService: DialogService) {
23 this.responsiveOptions = [
24 {
25 breakpoint: '1024px',
26 numVisible: 3,
27 numScroll: 3
28 },
29 {
30 breakpoint: '768px',
31 numVisible: 2,
32 numScroll: 2
33 },
34 {
35 breakpoint: '560px',
36 numVisible: 1,
37 numScroll: 1
38 }
39 ];
40 this.locations = [];
41 this.villages = [];
42 this.ref = new DynamicDialogRef;
43 }
44
45 ngOnInit(): void {
46
47 this.locationService.getWeekendGetaways().subscribe(
48 data => {
49 this.locations = data;
50 });
51
52 this.locationService.getVillages().subscribe(
53 village => {
54 this.villages = village;
55 }
56 );
57 }
58
59 onClickSignUp(){
60 console.log("VLEGOV");
61 this.ref = this.dialogService.open(RegisterComponent, {
62 header: 'Register form',
63 width: '70%',
64 contentStyle: { "max-height": "500px", "overflow": "auto" },
65 baseZIndex: 10000
66 });
67 }
68}
Note: See TracBrowser for help on using the repository browser.