Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 777c804

Browse files
committed
Namespace the directives with ui-select-
1 parent a873eb0 commit 777c804

File tree

6 files changed

+53
-53
lines changed

6 files changed

+53
-53
lines changed

examples/bootstrap.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
1414
<script>
1515
document.createElement('ui-select');
16-
document.createElement('match');
17-
document.createElement('choices');
16+
document.createElement('ui-select-match');
17+
document.createElement('ui-select-choices');
1818
</script>
1919
<![endif]-->
2020

@@ -47,11 +47,11 @@
4747
<div class="col-sm-6">
4848

4949
<ui-select ng-model="person.selected" theme="bootstrap">
50-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
51-
<choices repeat="item in people | filter: $select.search">
50+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
51+
<ui-select-choices repeat="item in people | filter: $select.search">
5252
<div ng-bind-html="item.name | highlight: $select.search"></div>
5353
<small ng-bind-html="item.email | highlight: $select.search"></small>
54-
</choices>
54+
</ui-select-choices>
5555
</ui-select>
5656

5757
</div>
@@ -63,11 +63,11 @@
6363
<div class="input-group">
6464

6565
<ui-select ng-model="person.selected" theme="bootstrap">
66-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
67-
<choices repeat="item in people | filter: $select.search">
66+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
67+
<ui-select-choices repeat="item in people | filter: $select.search">
6868
<span ng-bind-html="item.name | highlight: $select.search"></span>
6969
<small ng-bind-html="item.email | highlight: $select.search"></small>
70-
</choices>
70+
</ui-select-choices>
7171
</ui-select>
7272

7373
<span class="input-group-btn">
@@ -85,11 +85,11 @@
8585
<div class="col-sm-6">
8686

8787
<ui-select ng-model="person.selected" theme="bootstrap" ng-disabled="true">
88-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
89-
<choices repeat="item in people | filter: $select.search">
88+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
89+
<ui-select-choices repeat="item in people | filter: $select.search">
9090
<div ng-bind-html="item.name | highlight: $select.search"></div>
9191
<small ng-bind-html="item.email | highlight: $select.search"></small>
92-
</choices>
92+
</ui-select-choices>
9393
</ui-select>
9494

9595
</div>

examples/demo.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
1414
<script>
1515
document.createElement('ui-select');
16-
document.createElement('match');
17-
document.createElement('choices');
16+
document.createElement('ui-select-match');
17+
document.createElement('ui-select-choices');
1818
</script>
1919
<![endif]-->
2020

@@ -69,35 +69,35 @@ <h3>Bootstrap theme</h3>
6969
ng-disabled="disabled"
7070
reset-search-input="false"
7171
style="width: 300px;">
72-
<match placeholder="Enter an address...">{{$select.selected.formatted_address}}</match>
73-
<choices repeat="address in addresses track by $index"
72+
<ui-select-match placeholder="Enter an address...">{{$select.selected.formatted_address}}</ui-select-match>
73+
<ui-select-choices repeat="address in addresses track by $index"
7474
refresh="refreshAddresses($select.search)"
7575
refresh-delay="0">
7676
<div ng-bind-html="address.formatted_address | highlight: $select.search"></div>
77-
</choices>
77+
</ui-select-choices>
7878
</ui-select>
7979

8080
<h3>Select2 theme</h3>
8181
<p>Selected: {{person.selected}}</p>
8282
<ui-select ng-model="person.selected" theme="select2" ng-disabled="disabled" style="min-width: 300px;">
83-
<match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</match>
84-
<choices repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
83+
<ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match>
84+
<ui-select-choices repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
8585
<div ng-bind-html="person.name | highlight: $select.search"></div>
8686
<small>
8787
email: {{person.email}}
8888
age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
8989
</small>
90-
</choices>
90+
</ui-select-choices>
9191
</ui-select>
9292

9393
<h3>Selectize theme</h3>
9494
<p>Selected: {{country.selected}}</p>
9595
<ui-select ng-model="country.selected" theme="selectize" ng-disabled="disabled" style="width: 300px;">
96-
<match placeholder="Select or search a country in the list...">{{$select.selected.name}}</match>
97-
<choices repeat="country in countries | filter: $select.search">
96+
<ui-select-match placeholder="Select or search a country in the list...">{{$select.selected.name}}</ui-select-match>
97+
<ui-select-choices repeat="country in countries | filter: $select.search">
9898
<span ng-bind-html="country.name | highlight: $select.search"></span>
9999
<small ng-bind-html="country.code | highlight: $select.search"></small>
100-
</choices>
100+
</ui-select-choices>
101101
</ui-select>
102102
</body>
103103
</html>

examples/select2-bootstrap3.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
1414
<script>
1515
document.createElement('ui-select');
16-
document.createElement('match');
17-
document.createElement('choices');
16+
document.createElement('ui-select-match');
17+
document.createElement('ui-select-choices');
1818
</script>
1919
<![endif]-->
2020

@@ -54,11 +54,11 @@
5454
<div class="col-sm-6">
5555

5656
<ui-select ng-model="person.selected" theme="select2" class="form-control">
57-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
58-
<choices repeat="item in people | filter: $select.search">
57+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
58+
<ui-select-choices repeat="item in people | filter: $select.search">
5959
<div ng-bind-html="item.name | highlight: $select.search"></div>
6060
<small ng-bind-html="item.email | highlight: $select.search"></small>
61-
</choices>
61+
</ui-select-choices>
6262
</ui-select>
6363

6464
</div>
@@ -70,11 +70,11 @@
7070
<div class="input-group select2-bootstrap-append">
7171

7272
<ui-select ng-model="person.selected" theme="select2" class="form-control">
73-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
74-
<choices repeat="item in people | filter: $select.search">
73+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
74+
<ui-select-choices repeat="item in people | filter: $select.search">
7575
<span ng-bind-html="item.name | highlight: $select.search"></span>
7676
<small ng-bind-html="item.email | highlight: $select.search"></small>
77-
</choices>
77+
</ui-select-choices>
7878
</ui-select>
7979

8080
<span class="input-group-btn">
@@ -92,11 +92,11 @@
9292
<div class="col-sm-6">
9393

9494
<ui-select ng-model="person.selected" theme="select2" class="form-control" ng-disabled="true">
95-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
96-
<choices repeat="item in people | filter: $select.search">
95+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
96+
<ui-select-choices repeat="item in people | filter: $select.search">
9797
<div ng-bind-html="item.name | highlight: $select.search"></div>
9898
<small ng-bind-html="item.email | highlight: $select.search"></small>
99-
</choices>
99+
</ui-select-choices>
100100
</ui-select>
101101

102102
</div>

examples/selectize-bootstrap3.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
1414
<script>
1515
document.createElement('ui-select');
16-
document.createElement('match');
17-
document.createElement('choices');
16+
document.createElement('ui-select-match');
17+
document.createElement('ui-select-choices');
1818
</script>
1919
<![endif]-->
2020

@@ -69,11 +69,11 @@
6969
<div class="col-sm-6">
7070

7171
<ui-select ng-model="person.selected" theme="selectize">
72-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
73-
<choices repeat="item in people | filter: $select.search">
72+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
73+
<ui-select-choices repeat="item in people | filter: $select.search">
7474
<div ng-bind-html="item.name | highlight: $select.search"></div>
7575
<small ng-bind-html="item.email | highlight: $select.search"></small>
76-
</choices>
76+
</ui-select-choices>
7777
</ui-select>
7878

7979
</div>
@@ -85,11 +85,11 @@
8585
<div class="input-group">
8686

8787
<ui-select ng-model="person.selected" theme="selectize">
88-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
89-
<choices repeat="item in people | filter: $select.search">
88+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
89+
<ui-select-choices repeat="item in people | filter: $select.search">
9090
<span ng-bind-html="item.name | highlight: $select.search"></span>
9191
<small ng-bind-html="item.email | highlight: $select.search"></small>
92-
</choices>
92+
</ui-select-choices>
9393
</ui-select>
9494

9595
<span class="input-group-btn">
@@ -107,11 +107,11 @@
107107
<div class="col-sm-6">
108108

109109
<ui-select ng-model="person.selected" theme="selectize" class="form-control" ng-disabled="true">
110-
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
111-
<choices repeat="item in people | filter: $select.search">
110+
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
111+
<ui-select-choices repeat="item in people | filter: $select.search">
112112
<div ng-bind-html="item.name | highlight: $select.search"></div>
113113
<small ng-bind-html="item.email | highlight: $select.search"></small>
114-
</choices>
114+
</ui-select-choices>
115115
</ui-select>
116116

117117
</div>

src/select.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ angular.module('ui.select', [])
114114
ctrl.open = false;
115115
ctrl.disabled = undefined; // Initialized inside uiSelect directive link function
116116
ctrl.resetSearchInput = undefined; // Initialized inside uiSelect directive link function
117-
ctrl.refreshDelay = undefined; // Initialized inside choices directive link function
117+
ctrl.refreshDelay = undefined; // Initialized inside uiSelectChoices directive link function
118118

119119
var _searchInput = $element.querySelectorAll('input.ui-select-search');
120120
if (_searchInput.length !== 1) {
@@ -371,7 +371,7 @@ angular.module('ui.select', [])
371371
};
372372
}])
373373

374-
.directive('choices',
374+
.directive('uiSelectChoices',
375375
['uiSelectConfig', 'RepeatParser', 'uiSelectMinErr',
376376
function(uiSelectConfig, RepeatParser, uiSelectMinErr) {
377377

@@ -416,7 +416,7 @@ angular.module('ui.select', [])
416416
};
417417
}])
418418

419-
.directive('match', ['uiSelectConfig', function(uiSelectConfig) {
419+
.directive('uiSelectMatch', ['uiSelectConfig', function(uiSelectConfig) {
420420
return {
421421
restrict: 'EA',
422422
require: '^uiSelect',

test/select.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ describe('ui-select tests', function() {
3939

4040
return compileTemplate(
4141
'<ui-select ng-model="selection"' + attrsHtml + '> \
42-
<match placeholder="Pick one...">{{$select.selected.name}}</match> \
43-
<choices repeat="person in people | filter: $select.search"> \
42+
<ui-select-match placeholder="Pick one...">{{$select.selected.name}}</ui-select-match> \
43+
<ui-select-choices repeat="person in people | filter: $select.search"> \
4444
<div ng-bind-html="person.name | highlight: $select.search"></div> \
4545
<div ng-bind-html="person.email | highlight: $select.search"></div> \
46-
</choices> \
46+
</ui-select-choices> \
4747
</ui-select>'
4848
);
4949
}
@@ -169,10 +169,10 @@ describe('ui-select tests', function() {
169169

170170
var el = compileTemplate(
171171
'<ui-select ng-model="selection"> \
172-
<match>{{$select.selected}}</match> \
173-
<choices repeat="item in items | filter: $select.search"> \
172+
<ui-select-match>{{$select.selected}}</ui-select-match> \
173+
<ui-select-choices repeat="item in items | filter: $select.search"> \
174174
<div ng-bind-html="item | highlight: $select.search"></div> \
175-
</choices> \
175+
</ui-select-choices> \
176176
</ui-select>'
177177
);
178178
expect(el.scope().$select.selected).toEqual(undefined);

0 commit comments

Comments
 (0)