Skip to content

Commit 42712d2

Browse files
committed
chore(readme): update README.md for global options
Add an example of specifying a global config value
1 parent 4e448c6 commit 42712d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ myAppModule.controller('MyController', function($scope) {
8888
</select>
8989
```
9090

91-
Some time it may make sense to specify the options in the template file.
91+
Some times it may make sense to specify the options in the template file.
9292

9393
```html
9494
<select ui-select2="{ allowClear: true}" ng-model="select2">
@@ -98,6 +98,14 @@ Some time it may make sense to specify the options in the template file.
9898
</select>
9999
```
100100

101+
To define global defaults, you can configure the `uiSelect2Config` injectable:
102+
103+
```javascript
104+
myAppModule.run(['uiSelect2Config', function(uiSelect2Config) {
105+
uiSelect2Config.placeholder = "Placeholder text";
106+
}]);
107+
```
108+
101109
## Working with ng-model
102110

103111
The ui-select2 directive plays nicely with ng-model and validation directives such as ng-required.

0 commit comments

Comments
 (0)