angularjs filter (not working)

前端 未结 7 1337
灰色年华
灰色年华 2020-12-25 14:56

The following HTML, Javascript and JSON render correctly, but the filter does not work at all. What are we doing wrong?



        
7条回答
  •  旧巷少年郎
    2020-12-25 15:51

    Angular filters cannot handle an object of objects as input. ng-repeat can render them, but filters expect an array of objects. The easiest way to fix this is to let the server return an array without named keys. You could also transform the response in angular after each request (more expensive).

提交回复
热议问题