You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, thanks for your useful lib.
I wanted to report you a bug. when I used your source I had a problem with the empty list and I got error from 'highlight' filter.Then I added a little change on the last if in your code.The new one is below :
app.filter('highlight', ['$sce', function ($sce) {
return function (input, searchParam) {
if (typeof input === 'function') return '';
if (searchParam) {
var words = '(' +
searchParam.split(/\ /).join(' |') + '|' +
searchParam.split(/\ /).join('|') +
')',
exp = new RegExp(words, 'gi');
if (words.length && input!=undefined) {
input = input.replace(exp, "<span class="highlight">$1");
}
}
return $sce.trustAsHtml(input);
};
}]);
The text was updated successfully, but these errors were encountered:
hi, thanks for your useful lib.
I wanted to report you a bug. when I used your source I had a problem with the empty list and I got error from 'highlight' filter.Then I added a little change on the last if in your code.The new one is below :
app.filter('highlight', ['$sce', function ($sce) {
return function (input, searchParam) {
if (typeof input === 'function') return '';
if (searchParam) {
var words = '(' +
searchParam.split(/\ /).join(' |') + '|' +
searchParam.split(/\ /).join('|') +
')',
exp = new RegExp(words, 'gi');
if (words.length && input!=undefined) {
input = input.replace(exp, "<span class="highlight">$1");
}
}
return $sce.trustAsHtml(input);
};
}]);
The text was updated successfully, but these errors were encountered: