Filter in ng-options of ionic 1


#1

I am applying the same code of below to my ionic 1 project :

http://jsfiddle.net/dw20jakt/

However, when I selected country, corresponding option of state can’t be showed and have the below error :

ionic.bundle.js:26794 Error: [$injector:undef] Provider 'filterFilter' must return a value from $get factory method.
http://errors.angularjs.org/1.5.3/$injector/undef?p0=filterFilter

error reference : https://docs.angularjs.org/error/$injector/undef?p0=filterFilter

May I know why did it happen ? Do I need to inject any filter or customise a filter if I want to use the basic filter function for ng-option in ionic1 ?

Many thanks.


#2

Solved. I found if i added below module, I must return value for the filter. If I removed it, i can use the filter without inject the filter module.

angular.module(‘App’).filter(‘filter’, function() {
//Define your filter here.
});