How do I filter an array with AngularJS and use a property of the filtered object as the ng-model attribute?

前端 未结 8 1428
刺人心
刺人心 2020-11-30 19:17

If I have an array of objects, and I want to bind the Angular model to a property of one of the elements based on a filter, how do I do that? I can explain better with a con

相关标签:
8条回答
  • 2020-11-30 19:43

    Applying same filter in HTML with multiple columns, just example:

     variable = (array | filter : {Lookup1Id : subject.Lookup1Id, Lookup2Id : subject.Lookup2Id} : true)
    
    0 讨论(0)
  • 2020-11-30 19:44
    <div ng-repeat="subject in results.subjects | filter:{grade:'C'}">
        <input ng-model="subject.title" />
    </div>
    
    0 讨论(0)
提交回复
热议问题