Maybe someone can help me out. I have an Array within an object. I can get just the Array(Articles) out of the object. That is not my problem. My problem is that i am now using an *ngFor within Angular to read the list of Articles, but there is no id. The IDs are generated.
How can I get Angular to read from this?
I can read the array by placing in articles[0] or articles1 but i need to get all articles and individually specifying is not going to work. Any help would be amazing! Thanks guys.
TS Page
blog: string[];
blogs: string[] = [];
ngOnInit() {
this.getNewsData().subscribe((blog) => {
this.blogs.push(blog);
console.log(blog.articles);
});
component.html file
<mat-card class="example-card" *ngFor="let blog of blogs.articles">
<mat-card-header>
<div mat-card-avatar class="example-header-image"></div>
<mat-card-title>{{ blog.title }}</mat-card-title>
<mat-card-subtitle>{{ blog.author }}</mat-card-subtitle>
</mat-card-header>
<img mat-card-image src="{{ blog.urlToImage }}" alt="Photo of a Shiba Inu">
<mat-card-content>
<p>
{{ blog.titles }}
</p>
</mat-card-content>
<mat-card-actions>
<button mat-button>LIKE</button>
<button mat-button>SHARE</button>
</mat-card-actions>
</mat-card>

<p *ngFor="let x of yourObject.articles">{{x.title}}</p>?blogs? What does your HTML look like?