While doing official Angular tutorial, I tried to make a real backend connection instead of mock Angular "server", using Spring JPA REST. REST endpoint is configured as PagingAndSortingRepository. Here is a server response from backend.

I try to get this data into front-end as follows:
@Injectable({
providedIn: 'root'
})
export class HeroService {
private heroesUrl = 'http://localhost:8080/api/heroes';
constructor(
private http: HttpClient,
private messageService: MessageService ) { }
getHeroes(): Observable<Hero[]> {
// TODO: send the message _after_ fetching the heroes
this.messageService.add('HeroService: fetched heroes');
return this.http.get<Hero[]>(this.heroesUrl); // of(HEROES);
}
HTML code:
<h2>My Heroes</h2>
<ul class="list-group">
<li class="list-group-item" *ngFor="let hero of heroes">
<a routerLink="/detail/{{hero.id}}">
<span class="badge badge-dark">{{hero.id}}</span> {{hero.name}}
</a>
</li>
</ul>
This code produces following error:
ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
getHeroes()method