I have a function in controller like this.
cl.translateCall = function () {
$http.get(`${API_URL}/langChange/` + selectedLanguage).
then(function onSuccess(response) {
input = response.data;
console.log(input)
}).
catch(function onError(response) {
console.log(response)
});
}
I have a custom filter in module like this
.filter('languageTranslate',['$http', function($http) {
return function(input) {
if(selectedLanguage != null){
/*want to call controller function*/
}else{
return input;
}
}
}]);
How do I call the above controller function inside this Angular JS custom filter? I am totally new to Angular JS.