Skip to content

Commit 79212f9

Browse files
committed
Updated README
1 parent 7165fb2 commit 79212f9

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ labelAttr | `String` | `"label"` | Name of the label key in options array.
7373
groupAttr | `String` | `"group"` | Name of the `optgroup` label key in options array. It allows to group items by the selected key. Items have to be already sorted to see the groups just one time.
7474
rtl | `Boolean` | `false` | Two-way bindable attribute to set a Right-To-Left text direction.
7575
api | `Object` | `{}` | This object is equipped with the methods for interacting with the selector. Check out the ["APIs" example](http://indrimuska.github.io/angular-selector/).
76-
create | `Boolean` | `Function` | | Allows user to type their own tag and select 'Add' from suggestions list. Optionally pass through function to format tag data
76+
create | `Boolean` or `Function` | | Allows user to type their own options and push them into the options array. You can pass a function that returns the full format of the tag data, using `input` as parameter, or set it to `true` to have an option object with `valueAttr` a `labelAttr` properties.
7777
change | `Function` | | Callback fired every time the selected values change. It provides two parameters: `newValue` and `oldValue`.
7878
remote | `Object` | <pre>{<br> method: 'GET',<br> cache: true,<br> params: {}<br>}</pre> | Configuration object to pass to the native `$http` service ([docs](https://docs.angularjs.org/api/ng/service/$http#usage)).
7979
remoteParam | `String` | `"q"` | Name of the query key in the remote parameter object. You should use this parameter to perform server-side filtering.

dist/angular-selector.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@
279279
option[scope.labelAttr] = e.target.value;
280280
option[scope.valueAttr || 'value'] = e.target.value;
281281
}
282-
283282
scope.options.push(option);
284283
scope.set(option);
285284
}
@@ -461,8 +460,8 @@
461460
.run(['$templateCache', function ($templateCache) {
462461
$templateCache.put('selector/selector.html',
463462
'<div class="selector" ng-attr-dir="{{rtl ? \'rtl\' : \'ltr\'}}" ' +
464-
'ng-class="{open: isOpen, empty: !filteredOptions.length && (!create || !search), multiple: multiple, \'has-value\': hasValue(), rtl: rtl, loading: loading, ' +
465-
'\'remove-button\': removeButton, disabled: disabled}">' +
463+
'ng-class="{open: isOpen, empty: !filteredOptions.length && (!create || !search), multiple: multiple, \'has-value\': hasValue(), rtl: rtl, ' +
464+
'loading: loading, \'remove-button\': removeButton, disabled: disabled}">' +
466465
'<select name="{{name}}" ng-hide="true" ' +
467466
'ng-model="selectedValues" multiple ng-options="option as option[labelAttr] for option in selectedValues" ng-hide="true"></select>' +
468467
'<label class="selector-input">' +

src/angular-selector.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@
279279
option[scope.labelAttr] = e.target.value;
280280
option[scope.valueAttr || 'value'] = e.target.value;
281281
}
282-
283282
scope.options.push(option);
284283
scope.set(option);
285284
}
@@ -461,8 +460,8 @@
461460
.run(['$templateCache', function ($templateCache) {
462461
$templateCache.put('selector/selector.html',
463462
'<div class="selector" ng-attr-dir="{{rtl ? \'rtl\' : \'ltr\'}}" ' +
464-
'ng-class="{open: isOpen, empty: !filteredOptions.length && (!create || !search), multiple: multiple, \'has-value\': hasValue(), rtl: rtl, loading: loading, ' +
465-
'\'remove-button\': removeButton, disabled: disabled}">' +
463+
'ng-class="{open: isOpen, empty: !filteredOptions.length && (!create || !search), multiple: multiple, \'has-value\': hasValue(), rtl: rtl, ' +
464+
'loading: loading, \'remove-button\': removeButton, disabled: disabled}">' +
466465
'<select name="{{name}}" ng-hide="true" ' +
467466
'ng-model="selectedValues" multiple ng-options="option as option[labelAttr] for option in selectedValues" ng-hide="true"></select>' +
468467
'<label class="selector-input">' +

0 commit comments

Comments
 (0)