Я пытаюсь отобразить данные на внешнем интерфейсе, но получаю вышеуказанную ошибку. Как решить эту проблему?
service.ts
rec_source(){
var headers = new HttpHeaders().set('Authorization', 'Token ' + localStorage.getItem('usertoken'));
headers.append('Accept', 'application/json');
var options = {
headers: headers
};
return this.httpClient.get('api/recruit/fetch_recruitment_details',options)
}
component.ts
sources:any = [];
constructor(private Authentication:AuthService) { }
ngOnInit() {
this.Authentication.rec_source()
.subscribe(source => {
this.sources = source;
});
}
component.html
<table *ngIf="sources" class="row-border hover">
<thead>
<tr>
<th>Data</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let source of sources">
<td>{{ source}}</td>
</tr>
</tbody>
</table>
// данные, которые должны отображаться
![the data that needs to be displayed](https://i.stack.imgur.com/d2Jle.png)
// ошибка
![the error](https://i.stack.imgur.com/pY7PJ.png)