-2
I’m building an . net core API using c# with visual studio 2019. the entities are publisher and book and testing via Swagger and Postman, the CRUD of both is working perfectly.
However, I started the implementation using the angular to consume this API and that’s where I’m having problems.
In the book register, there is a "dropdownlist" where the registered publishers should appear to link to the new book that will be registered, but this list is not being displayed and I have no idea why. Just like listing the books already registered, nothing appears, and there are records in the database and everything works perfectly running directly in the API. Below snippet of the code where the error is happening.
This whole project I went up to a repository on Github, follow the link: https://github.com/LDiegoDev/API-Biblioteca
<div class="form-group">
<label class="control-label" for="EditoraId">Editora</label>
<select class="form-control" data-val="true" formControlName="editoraId"
data-val-required="O campo Editora é obrigatório" id="EditoraId" name="EditoraId">
<option></option>
<option *ngFor='let editora of editoras' value="{{ editora.id }}">{{ editora.nome }}</option>
</select>
ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor
only supports binding to Iterables such as Arrays. at NgForOf.push../node_modules/@angular/common/fesm5/common.js.NgForOf.ngDoCheck
(common.js:3368) at checkAndUpdateDirectiveInline (core.js:22102) at checkAndUpdateNodeInline (core.js:23363) at checkAndUpdateNode (core.js:23325)
at debugCheckAndUpdateNode (core.js:23959) at debugCheckDirectivesFn (core.js:23919) at Object.eval [as updateDirectives] (ListaComponent.html:23)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:23911) at checkAndUpdateView (core.js:23307) at callViewAction (core.js:23548)
View_ListaComponent_0 @ ListaComponent.html:8 ListaComponent.html:8 ERROR CONTEXT DebugContext_