Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays

后端 未结 18 1242
逝去的感伤
逝去的感伤 2020-11-29 05:50

I looked at similar questions, but none of them helped me. I am going to receive an object like the following:

[
  {
    \"id\": 1,
    \"name\": \"Safa\",
          


        
18条回答
  •  时光说笑
    2020-11-29 06:10

    i have the same problem. this is how i fixed the problem. first when the error is occurred, my array data is coming form DB like this --,

    {brands: Array(5), _id: "5ae9455f7f7af749cb2d3740"} 
    

    make sure that your data is an ARRAY, not an OBJECT that carries an array. only array look like this --,

    (5) [{…}, {…}, {…}, {…}, {…}]
    

    it solved my problem.

提交回复
热议问题