Currently, I am attempting to utilize the filter service in AngularJS within my Chrome extension. However, I am unsure of how to properly obtain and inject it into my function. At this time, my code looks like:
chrome.contextMenus.onClicked.addListener(function(info, tab) {
result = $filter('filter')(jsonArray, info.selectionText, function (actual, expected) {
return actual.toString().toLowerCase().indexOf(expected.toLowerCase()) == 0;
});
console.log(sug);
});
Unfortunately, I am encountering an error: $filter is not defined. Additionally, I would like to incorporate the $http service to retrieve my jsonArray.