3

I have a situation where the text to select is too long and doesn't fit in the list width or in the selected field. So at least I need to show on mouse hover the complete name using the title attribute in span.

I tried this:

   <ui-select ng-model="f.fieldb.value">
      <ui-select-match>
        <span ng-bind="$select.selected.nm" title="$select.selected.nm"></span>
      </ui-select-match>
      <ui-select-choices repeat="item in (fieldsList | filter: $select.search)">
                <span ng-bind="item.nm" title="f.item.nm"></span>
      </ui-select-choices>
   </ui-select>

but I get this (note that the text shown next to the mouse pointer is incorrect):

enter image description here

enter image description here

Is it possible to get the correct names?

ps0604
  • 1,227
  • 23
  • 133
  • 330

1 Answers1

4

You need to evaluate them as expressions like so:

title="{{f.item.nm}}"

You are currently setting the title as the string "f.item.nm", not the value of nm held in the item object

cnorthfield
  • 3,384
  • 15
  • 22