Skip to content

Conversation

@marianocarpentier
Copy link

This change is in order to support the track by option into the ng-options when you have a complex object as option. So now, I can do this:

<select selectpicker class="fps" ng-model="selectedXxx" ng-options="f as f.value for f in xxx track by f.name">

having devined my model as:

$scope.selectedXxx = null;
$.each(data.xxx, function(el) {
      $scope.xxx.push({'name': el, 'value': data.xxx[el]});
});
$scope.selectedXxx = $scope.xxx[0];

I've changed just some lines in src/angular-bootstrap-select.js, but later compiled the directive with grunt and that replaced the other files. The change itself is really small.

sovattha added a commit to sovattha/angular-bootstrap-select that referenced this pull request Nov 26, 2015
Simple support of track by, based on the work of marianocarpentier (joaoneto#52)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant