component.ts file
posts= [];
constructor( private http:HttpClient) {
http.get('https://jsonplaceholder.typicode.com/posts')
.subscribe(response=>{
this.posts.push(response)
console.log(this.posts)
});
}
Within the HTML file
<ul class="list-group">
<li
*ngFor="let post of posts"
class="list-group-item">{{post.title}}</li>
</ul>
While I can successfully see the data from array in the console log, the *ngFor directive appears to only display an empty container. Strange!