angularify/angular-semantic-ui

Dropdown key,value support

iberflow opened this issue · 2 comments

I'm trying to populate the dropdown from an array of objects. I need the value to be the object ID and the title the object label. How do I achieve this?

The current version of angular-semantic-ui doesn't support that.
If you really want to achieve it, you need to edit dropdownGroup directive and add a new attribute to store the value (in our case, the object ID).
Something like that:

<dropdown-group value="12345">Title</dropdown-group>

Last thing to do is to update the click handler:

element.bind('click', function () {
    DropDownController.update_title(scope.item_value);
});

I merged your pull request. Thanks @Kurmaev