Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified to work with "track by" #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant