Comments (8)
Sadly can reproduce this issue:
my html code <select ng-model="setting" ng-options="k as v | translate for (k,v) in settings" ></select>
renders as
whereas <select class="selectpicker" ng-model="setting" ng-options="k as v | translate for (k,v) in settings" ></select>
just renders
(with nothing selectable)
from angular-bootstrap-select.
Has this issue been addressed? Anyone have a work around?
from angular-bootstrap-select.
Same issue...
Edit: Ended up using this directive and it works great:
.angular.module("myApp", []).directive('selectPicker', function($timeout) { return { link: function(scope, element, attrs) { $timeout(function() { $(element).selectpicker(); }, 0); } }; });
from angular-bootstrap-select.
It's better to just always run the selectpicker('refresh')
method, which reacts when options change.
from angular-bootstrap-select.
See my issue about this #7
from angular-bootstrap-select.
So the problem is that the directive in this library doesn't observe the options for changes. It never calls selectpicker('refresh')
. Here's the directive I'm using instead of this library. As a bonus, it works when I define my options using ng-repeat
on an <optgroup>
inside the <select>
. The drawback is that it only works in browsers that support MutationObserver.
app.directive('ngSelectPicker', ['$timeout', '$parse', function($timeout, $parse) {
return {
link: function($scope, elt, attrs) {
var refresh = function() {
$(elt).selectpicker('refresh')
}
$timeout(refresh, 0)
obs = new MutationObserver(refresh)
obs.observe(elt.get(0), {
attributes: true,
characterData: true,
childList: true,
subtree: true
})
}
}
}])
from angular-bootstrap-select.
Yep, my solutions supports also ng-repeat, ng-options, etc. and it should also observe possible changes of that collection.
from angular-bootstrap-select.
Solved
#7
from angular-bootstrap-select.
Related Issues (20)
- Question : Why does not default selectpicker work?
- 0.1.0-rc2 files under build folder is not built from src?
- Still have 'Nothing Selected' when trying to use Ng-options HOT 1
- Up/Down keys do not work with options list
- ng-options Doesn't Rebind After Scope Variable Change HOT 12
- bower package is not published
- Default picker choice? HOT 1
- selectpicker directive not in README file
- Significant slow down with a lot of options HOT 1
- Multi render
- syntax err line 8 HOT 1
- Doesn't support track by in ng-option HOT 1
- dropdown-toggle doesn't close when used within ng-form
- Directive is duplicating the dropdown boxes in a ng-table column HOT 8
- Support for optgroups?
- Is there a support for options with search? HOT 1
- with ng-model twice selct boxes HOT 1
- ng-options support in angular 1.4
- Livesearch to filter data by mapping string in the begining
- Click event not triggered on document
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-bootstrap-select.