0

ng-model="customer.selected" is not working. It is not showing any customer

<p>Selected: {{customer.selected}}</p>
     <div class="col-md-3">          
       <ui-select ng-model="customer.selected" theme="select2" class="input-md">
        <ui-select-match placeholder="Select a Customer">{{ $select.selected.name }}</ui-select-match>
          <ui-select-choices repeat="customer in customers | propsFilter: {name: $select.search}">
           <div ng-bind-html="customer.name | highlight: $select.search"></div>
          </ui-select-choices>
        </ui-select>
    </div>
2
  • Can you share you controller code? Or even better a plnkr of what you've tried? Commented Jan 20, 2016 at 9:17
  • is there console error? Commented Jan 20, 2016 at 9:18

1 Answer 1

1

Set the model value to default value in your controller like this and then it should work.

$scope.customer = {};
$scope.customer.selected = {};
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.