0

When I am doing filtering with UI Select the added span tag is appearing as text and not being rendered as html. I have a pic below to illustrate what I am seeing. Any thoughts or ideas? Here is the markup for my UI select if it helps

                <ui-select autofocus="autofocus" ng-model="activity.activityCode" theme="bootstrap">
                <ui-select-match allow-clear="false"
                        placeholder="{{scheduler.activityModal.activityCodePlaceholder | translate}}">
                    <div class="activity-code-color" style="background-color:{{$select.selected.color}}">&nbsp;</div>
                    <div class="activity-code-item">{{$select.selected.title}}</div>
                </ui-select-match>
                <ui-select-choices repeat="act in activities | filter: { title: $select.search }">
                    <div class="row">
                        <div class="activity-code-color" style="background-color:{{act.color}}">&nbsp;</div>
                        <div class="activity-code-item">{{ act.title | highlight: $select.search }}</div>
                    </div>
                </ui-select-choices>
            </ui-select>

enter image description here

1 Answer 1

2

Since you try to bind html template, you need to use ngBindHtml directive:

In html:

<div 
    class="activity-code-item" 
    ng-bind-html="act.title | highlight: $select.search">
</div>

API reference

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.