0

Hi i have situation were multiple ng-repeat are nested as

 <form  ng-repeat="pt in prolist">
Frequency <input  type="checkbox" ng-model="pt.req"  />
 <div ng-repeat="disc in prolist">
    ------
</div>
</form>

What I am trying to do is something like this

  <div ng-repeat="disc in prolist" where pt.id =disc.Pt_id>

Please let me know how to write this line of code in angularjs Thanks

0

3 Answers 3

3

You would basically turn that "where..." for into a filter pipe: http://docs.angularjs.org/api/ng/filter/filter

E.g., try:

ng-repeat="disc in prolist | filter:{Pt_id: pt.id}" ...
Sign up to request clarification or add additional context in comments.

Comments

0

You can filter repeaters in AngularJS. Try using filter, the following link displays how to use filters with ng-repeat.

ng-repeat with filter

Comments

0

if your data set is huge then do the filtering in javascript and then push the objects to $scope.prolist to render that in view because filters affect the performance badly but for small data sets it is fine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.