Last active
April 26, 2017 00:00
-
-
Save nickcherry/30f773265db349c93049 to your computer and use it in GitHub Desktop.
custom-angular-select (array of objects)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module 'angular-custom-select-examples', ['angular-custom-select'] | |
.controller 'ExamplesController', ($scope) -> | |
$scope.selectedValues = {} | |
$scope.objects = [ | |
{ name: 'Option A' } | |
, { name: 'Option B' } | |
, { name: 'Option C' } | |
, { name: 'Option D (disabled)', disabled: true } | |
, { name: 'Option E' } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<custom-select | |
ng-model="selectedValues.object" | |
ng-options="object as object.name for object in objects" | |
placeholder="Select one of these object values..." | |
disabled-attribute="disabled"> | |
</custom-select> | |
<div class="selected-value"> | |
Selected Value: {{ selectedValues.object || 'N/A' }} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment