$scope.sortcriteria = function($scope.chapters) {
var filtered = [];
for (var i = 0; i < $scope.chapters.length; i++) {
var chapter = $scope.chapters[i];
var chapterName = chapter.name;
var n = chapterName.indexOf(":");
if (i==(n-1)) {
filtered.push(chapter);
}
}
return filtered;
};// this is my function in controller<span ng-repeat="chapter in chapters | filter:sortcriteria"> this is my view file filter
angularjs error injector unpr unknown provider sortcriteriaFilterProvider <- sortcriteriaFilter
unable to find the error could you help me out