Having a root controller in my AngularJS
web application with a filter. The filter functions properly when applied in the html
template, but it fails to work when attempted to be applied in the controller.
function Controller ( ... deps ...) {
filter = $filter('my_filter');
$scope.$apply(function(){$scope.error_message = filter('ERROR');});
}
The filter
should simply return an error
string to the <p>
, but for some reason, it's not working.
If I do:
<p>{{'....' | my_filter}}</p>
It works perfectly fine. Why is that?
Thank you.