import {Component} from '@angular/core';
import {Router} from '@angular/router';
import {ApiService} from '../../services/api';
import {PortfolioService} from '../../services/portfolio.service';

@Component({
  selector: 'app-root',
  templateUrl: './landing.component.html',
})
export class LandingComponent {

  constructor(
    private apiService: ApiService,
    private portfolioService: PortfolioService,
    private router: Router,
  ) {
  }

  signUp(): void {
    this.router.navigate(['/register']);
  }

  exemple() {
    this.portfolioService.getRandomPortfolio().subscribe({
        next: (res) => {
          window.location.href = 'https://' + res.data.host;
        }

      }
    )
  }
}
