I have root controller in my AngularJS web application and filter. Filter works if i apply it in the html template, but it doesn't work if i'm trying to apply filter in the controller.
function Controller ( ... deps ...) {
filter = $filter('my_filter');
$scope.$apply(function(){$scope.error_message = filter('ERROR');});
}
filter must returns simple error string to the <p>, it doesn't work.
If i make:
<p>{{'....' | my_filter}}</p>
It works. Why?
Thank you.