Encountering an error while attempting to display a class in the HTML.
<li>
<ul>
<li *ngFor="let refac of refactormodel" >
-- word_to_rename: {{refac.word_to_rename}}
-- renowned_word: {{refac.renowned_word}}
-- name: {{refac.name}}
</li>
</ul>
</li>
Desire for the class not to be displayed if it is empty, but currently encountering this error when trying to display it: ERROR Error: Error trying to diff 'nombreyo'. Only arrays and iterables are allowed
private refactormodel : getrefactormodel[] = [];
....
this.authService.getrefactor().subscribe((res : getrefactormodel[]) =>{
this.refactormodel = res;
});
getrefactor() {
return this.http.get(apiUrl + 'getRules');
}
refactormodel.ts:
export interface getrefactormodel {
word_to_rename: String;
renowned_word: String;
name: String;
}