Search code examples
angularjstypeaheadangular-straphtml-escape-characters

Angular Strap typeahead results with angle brackets


My results have legit brackets and they show up fine. But when I close brackets, the input value wiped clean of anything inside the brackets.

Typing "frank" returns:
frank<hotdog>
frankenstein

Typing "frank<hotdog" returns:
frank<hotdog>

Typing "frank<hotdog>" wipes out my input and replaces it with "frank" then returns:
frank<hotdog>
frankenstein

Solution

  • using angular-strap version 2.3.5. I just removed this line in the library to override it. But hopefully there is a fix later. var value = selected ? selected.toString().replace(/<(?:.|\n)*?>/gm, '') : '';