-
Notifications
You must be signed in to change notification settings - Fork 81
data-icon when using ng-options #10
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
Comments
@Bhaall, Code in <div ng-controller="SomeCtrl">
<h3>Works with option data-icon and ngOptions</h3>
<select selectpicker="">
<option value="">Select one</option>
<option ng-repeat="i in icons" value="{{i.id}}" data-icon="{{i.icon}}">{{i.title}}</option>
</select>
</div> .controller('SomeCtrl', function ($scope, $timeout) {
$scope.icons = [
{ id: 0, icon: 'glyphicon glyphicon-search', title: 'Search' },
{ id: 1, icon: 'glyphicon glyphicon-headphones', title: 'Headphones' },
{ id: 2, icon: 'glyphicon glyphicon-ok', title: 'Ok' },
{ id: 3, icon: 'glyphicon glyphicon-user', title: 'User' }
];
}) |
Hi!
Is this currently possible? |
Hi joaoneto - your solution doesn't work for me. I'm using angular 1.2.28 bootstrap select 1.6.3 and bootstrap 3.3.1. |
Is it possible to add an icon to dynamic options?
It's certainly possible to add to static options:
data-icon="icon-heart"
The icon is picked up by the jquery plugin.
But what if these options are being generated by ng-options? (At this point I don't care if it's the same icon repeated for each - I just want to know if placing an icon using ng-options is even possible with angular-bootstrap-select.)
The text was updated successfully, but these errors were encountered: