import { Component, OnInit } from '@angular/core';

import { HomeService } from './home.service';
import { Post } from '../core/entities';

@Component({
	selector: 'app-home',
	templateUrl: './home.component.html',
	styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
	listArticle: Array<Post>;
	title: string;

	constructor(
		private homeService: HomeService
	) {}

	ngOnInit(): void {
		this.homeService.getLastPosts().subscribe(lastPosts => {
			this.listArticle = lastPosts;
		});
	}
}
