Im trying to populate an angular table with data received from a restapi database but i cannot get it to populate at all. I can send the data to the console with console.log but i need to populate a table which i am unsure of how to do, any help is appreciated.
partycomponent.html
<tr *ngFor="let parties of partyArray">
<td>{{PARTY.MNEMONIC}}</td>
<td>{{PARTYNAME}}</td>
<td>{{PARTYCOLOUR}}</td>
</tr>
parties.component.ts
parties = [];
constructor(httpClient: HttpClient) {
httpClient.get('http://localhost:3000/parties')
.subscribe(obj => {
console.log(obj);
this.parties = obj as any[];
})
}
I can put the data into the console from the sql link above but cannot put it on screen inside the table I have made.
My sql works correctly and the link is correct as i can post the data to the console but just cannot seem to get it posting on screen. Any help is appreciated