import { Component, ViewChild } from '@angular/core';
import { FooterModalComponent } from './footer-modal/footer-modal/footer-modal.component';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent {
  @ViewChild('modal') modal!: FooterModalComponent;

  email: string = '';

  scrollToElement(el: HTMLElement){
    el.scrollIntoView({behavior: 'smooth'});
  }

  showModal() {
    if (this.email === "") return;
    
    this.modal.toggle();
    this.email = "";
  }
}
