import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { WpServiceService } from '../wp-service.service';


@Component({
  selector: 'app-home',
  templateUrl: './home.page.html',
  styleUrls: ['./home.page.scss'],
})
export class HomePage implements OnInit {

  imageslide :any = [];
  placelasted :any = [];
  sliderOne: any;

  slideOptsOne = {
    initialSlide: 0,
    slidesPerView: 1,
    autoplay: true
  };

  constructor(public navCtrl: NavController, private wpservice: WpServiceService) { }

  ngOnInit() {
    
    this.wpservice.getSlideshow().subscribe((data) => {
      this.imageslide = data;
      console.log('load imageslide');
    });

    this.wpservice.getLasted().subscribe((placedata) => {
      this.placelasted = placedata;
      console.log('load Place');
      console.log(placedata);
    });        
  }

}
