Skip to content

Commit 1d49475

Browse files
committed
release v0.5.0
1 parent b44dec1 commit 1d49475

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

build/ng-bootstrap-select.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ng-bootstrap-select v0.4.0
2+
* ng-bootstrap-select v0.5.0
33
*
44
* Licensed under MIT
55
*/
@@ -89,7 +89,8 @@ function selectpickerDirective($parse, $timeout) {
8989
restrict: 'A',
9090
priority: 1000,
9191
link: function (scope, element, attrs) {
92-
var $async = scope.$applyAsync ? '$applyAsync' : '$evalAsync'; // fall back to $evalAsync if using AngularJS v1.2.x
92+
var $async = scope.$applyAsync ? '$applyAsync' : '$evalAsync', // fall back to $evalAsync if using AngularJS v1.2.x
93+
selectCollection;
9394

9495
if (attrs.ngOptions) {
9596
var multiple = attrs.multiple,
@@ -100,7 +101,7 @@ function selectpickerDirective($parse, $timeout) {
100101
match = optionsExp.match(NG_OPTIONS_REGEXP);
101102

102103
// The collection to watch
103-
var collection = match[8];
104+
selectCollection = match[8];
104105
// The variable name for the value of the item in the collection
105106
var valueName = match[5] || match[7];
106107
// The variable name for the key of the item in the collection
@@ -129,7 +130,7 @@ function selectpickerDirective($parse, $timeout) {
129130
var displayFn = $parse(match[2] || match[1]);
130131
var groupByFn = $parse(match[3] || '');
131132
var disableWhenFn = $parse(match[4] || '');
132-
var valuesFn = $parse(collection);
133+
var valuesFn = $parse(selectCollection);
133134

134135
var locals = {};
135136
var getLocals = keyName ? function(value, key) {
@@ -140,18 +141,22 @@ function selectpickerDirective($parse, $timeout) {
140141
locals[valueName] = value;
141142
return locals;
142143
};
143-
144-
scope.$watch(collection, refresh, true);
145144

146145
scope[$async](function () {
147146
element.selectpicker($parse(attrs.selectpicker)());
148147
});
149148
} else {
149+
selectCollection = attrs.selectCollection;
150+
151+
element.selectpicker($parse(attrs.selectpicker)());
152+
150153
$timeout(function () { // fall back to $timeout for selects that don't use ng-options
151-
element.selectpicker($parse(attrs.selectpicker)());
154+
refresh();
152155
});
153156
}
154157

158+
if (selectCollection) scope.$watch(selectCollection, refresh, true);
159+
155160
function bindData(text) {
156161
var startIndex,
157162
endIndex,

build/ng-bootstrap-select.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-bootstrap-select",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "Directive to wrap bootstrap-select",
55
"devDependencies": {
66
"canonical-path": "0.0.2",

0 commit comments

Comments
 (0)