I'm using a filter to evaluate a couple of strings. If both of them are defined, I want to display them
string0 string1
else, I want to display a message like this:
at least one of the strings is empty
Here there is my filter
.filter('getStrsOrNoData', function () {
return function (s0, s1) {
if (s0 && s1 ) {
return s0 + ' ' + last;
} else {
return 'at least one of the strings is empty';
}
};
})
and here is how I declare it in HTML, passing in 2 arguments:
<p>{{string1 + string2 | getStrsOrNoData : string1 : string2 }}</p>
My problem is that when s0 && s1 is true, the displayed value is
string0string1 string0
I think the problem is string1 + string2 but I don't know how to state two vars on the left side of the pipe....