These are chat archives for angular-ui/ui-select

21st
May 2015
jlhoelter
@jlhoelter
May 21 2015 07:54
hey guys, thanks for the great select component first.
i have a question about changing the model for a single binded property
' <ui-select ng-model="card.id">
<ui-select-match>{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="item.id as item in reports | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
given your example
from the wiki
jlhoelter
@jlhoelter
May 21 2015 07:59
when i change card.id to a different id, there is some change happening but the text in ui-select-match is empty
how can i handle that properly ?
Ben Orozco
@benoror
May 21 2015 15:14
Shouldn't ng-model be set to "card" only?
Brad Davis
@that1guy
May 21 2015 16:25
Anyone kind enough to look at this question I opened yesterday? http://stackoverflow.com/questions/30362714/angular-ui-select-parent-and-child-grouping
Ben Orozco
@benoror
May 21 2015 17:50
What do you want to be selected? A parent or a child node?
If you want to select a parent you might use only 1 select, and display the nested data inline, like the 2nd example here: http://plnkr.co/edit/a3KlK8dKH3wwiiksDSn2?p=preview
if you want to select a child, I'm not sure if you could use ancient optgroup's like the example you posted in stackoverflow (http://plnkr.co/edit/yZXV3ckcESTQ22h4pbwX?p=preview)
but as a matter of fact I have a simmiliar use case
and my solution is to use not one but two selects in cascade
Ben Orozco
@benoror
May 21 2015 17:56
Here's an example (with regular selects): http://jsfiddle.net/annavester/Zd6uX/
Ben Orozco
@benoror
May 21 2015 18:04
Already answerd your stackoverflow post