22 lines
551 B
TypeScript
22 lines
551 B
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { DataService } from '@services/data.service';
|
|
import { Article } from '@interface/news';
|
|
|
|
@Component({
|
|
selector: 'app-blogs',
|
|
standalone: false,
|
|
templateUrl: './blogs.component.html',
|
|
styleUrl: './blogs.component.css'
|
|
})
|
|
export class BlogsComponent implements OnInit {
|
|
articles: Article[] = [];
|
|
|
|
constructor(private dataService: DataService) {}
|
|
|
|
ngOnInit(): void {
|
|
this.dataService.getNews().subscribe((response) => {
|
|
this.articles = response.articles;
|
|
});
|
|
}
|
|
}
|