Search code examples
angularjsangular-filters

How to pass the `string` values to angular filter


I am trying to filter the objects by it's status value. and i have multiple instance. i would like to pass the filter values by each of the filter calls. but not working, i am getting error, error details:

error

my html :

<ul>
    <li ng-repeat="issue in issueLogs | issueStatus:'Inprogress':'Open')">{{issue.Status}}</li>
</ul>

my filter :

angular.module("tcpApp")
.filter("issueStatus", 
    function () {
        return function ( object, param1, param2 ) {
            console.log( "params", param1, param2 )
        }
});

what is wrong here? any one help me


Solution

  • You have extra ) at issueStatus:'Inprogress':'Open')".

    Demo