Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thank you @roman-hutnyk and @cyrus-zhou for pointing out the klient.firstName mistake. However, I still cannot get default value using ng-model="customer.id" I get following: <select ng-model="customer.id" ng-options="klient.id as klient.firstName for klient in klienci track by klient.id" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"><option value="?" selected="selected"></option><option label="Michal" value="1">Michal</option><option label="Jan" value="2">Jan</option><option label="Stanislaw" value="3">Stanislaw</option></select> Only ng-model="customer" works Commented Jan 9, 2016 at 19:23
  • It seems that track by was an issue in my last case. Correct version: <select ng-model="customer.id" ng-options="klient.id as klient.firstName + ' ' + klient.lastName for klient in klienci" class="form-control"></select> Commented Jan 9, 2016 at 19:39
  • I think you browser auto add track by klient.id Commented Jan 9, 2016 at 19:41