-1

I have a table with a column of Status, and I want to filter the table base on their status and I have put on the selection element to do so. here is my code below for the selection

<select class="form-control" ng-model="OrdinanceStatus">
                                            <option value="">Select your option</option>
                                            <option value="1">Open</option>
                                            <option value="3">Amended</option>
                                            <option value="2">Due for amendment</option>
                                        </select>

and here is the table, Im thinking of ng-change but I dont know yet how to execute that

<div>
                        <table class="table table-bordered" id="headerTableRevenue">
                            <thead>
                                <tr>
                                    <td>LGU</td>
                                    <td>Title</td>
                                    <td>Status</td>
                                </tr>
                            </thead>
                            <tbody>
                                
                              <tr ng-repeat="a in OrdinanceReport | filter:{Status: OrdinanceStatus.Value}:true">
                                    <td>{{a.LGU}}</td>
                                    <td>{{a.OrdinanceTitle}}</td>
                                    <td>{{a.Status}}</td>
                                </tr> 
                            </tbody>
                        </table>
                    </div>

I tried putting this filter syntax inside the ng-repeat but its not working as expected of me.

filter:{Status: OrdinanceStatus.Value}:true

1 Answer 1

0

Try to update your filter expression to below

filter:{ Status: OrdinanceStatus }:true

Refer Plunker: https://plnkr.co/edit/zLh6dHY6cvipiBbw

Sign up to request clarification or add additional context in comments.

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.