ng2-select: Select multiple - search in items : error value.match is not a function (due to SafeHtmlImpl)

Hello

In “select multiple”, when you search an items (input text), I’ve an error :

EXCEPTION: Error in ./SelectComponent class SelectComponent - inline template:106:19 caused by: t.match is not a function

(Chrome & FF + Angular Final 2.0.0) Same issue with your demo.

The error is into the HighlightPipe : var tagList = value.match(tagRE); due to value is not a string but instance of SafeHtmlImpl

I don’t known if it’s the best soltuion, but you could fix it with :

        if (value instanceof SafeHtmlImpl) {
            value = value.changingThisBreaksApplicationSecurity;
        }

thkx

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 17

Most upvoted comments

Any news on this ?

I can’t highlight enough, how important it is to fix this asap.