I am using Angularjs and have a dropdownlist with "Any State" or "New York","New Jersey" etc and based on selection of dropdownlist value I should display the products in the Grid that are available in each state with columns "Product Name" ,"Availabilty". The "Availabilty" column contain value either "All States" or individual state name's such as (California,Michigan) or (New Jersey,New York) etc .For instance if I select "Any State" in the dropdown and Grid should display all records and if I select "New Jersey" state it should display records with "Availabilty" column value either "All States" and "New Jersey,New York"

I have a example here in fiddler http://jsfiddle.net/s2Ff9/9/ and I stuck at filterdata function in the controller that filters data based on dropdown selection and I believe should have foreach and indexOf methods to achieve this.Any sample code for filterdata function would be highly appreciated.

Thanks in Advance