I have a list of strings that I want to iterate through, but I want to be able to filter them using a search term. Like this:
"No matches"
{{ item }}
Alternatively you could modify your pipe to return a specific token that indicates that the list is empty
@Pipe({
name: 'search'
})
export class SearchPipe {
transform(value, searchTerm) {
let result = ...
if(result.length === 0) {
return [-1];
}
return result;
}
}
"No matches"
{{ item }}