Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c88605c

Browse files
committed
make jshint and jscs happy
1 parent bb7209d commit c88605c

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/ng/directive/select.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,6 @@ var selectDirective = function() {
494494
// Read value now needs to check each option to see if it is selected
495495
selectCtrl.readValue = function readMultipleValue() {
496496
var array = [];
497-
var options = element.find('option')
498497
forEach(element.find('option'), function(option) {
499498
if (option.selected && !option.disabled) {
500499
var val = option.value;
@@ -562,6 +561,7 @@ var optionDirective = ['$interpolate', function($interpolate) {
562561
var interpolateValueFn, interpolateTextFn;
563562

564563
if (isDefined(attr.ngValue)) {
564+
// jshint noempty: false
565565
// Will be handled by registerOption
566566
} else if (isDefined(attr.value)) {
567567
// If the value attribute is defined, check if it contains an interpolation

test/ng/directive/selectSpec.js

+13-10
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ describe('select', function() {
14881488
optionElements = element.find('option');
14891489
expect(optionElements.length).toEqual(3);
14901490
expect(scope.obj.value).toBe(null);
1491-
expect(element.val()).toBe(prop === 'ngValue' ? '? object:4 ?' : '? string:A ?')
1491+
expect(element.val()).toBe(prop === 'ngValue' ? '? object:4 ?' : '? string:A ?');
14921492
});
14931493

14941494

@@ -1538,7 +1538,7 @@ describe('select', function() {
15381538
optionElements = element.find('option');
15391539
expect(optionElements.length).toEqual(4);
15401540
expect(scope.obj.value).toBe(null);
1541-
expect(element.val()).toBe('? string:A ?')
1541+
expect(element.val()).toBe('? string:A ?');
15421542
});
15431543

15441544

@@ -1631,7 +1631,7 @@ describe('select', function() {
16311631
B.disabled = true;
16321632
scope.$digest();
16331633

1634-
var optionElements = element.find('option');
1634+
optionElements = element.find('option');
16351635
expect(optionElements.length).toEqual(4);
16361636
expect(optionElements[0].value).toEqual(unknownValue(undefined));
16371637

@@ -1717,7 +1717,7 @@ describe('select', function() {
17171717

17181718
scope.options = [A, B];
17191719
scope.obj = {
1720-
value : prop === 'ngValue' ? C : 'C'
1720+
value: prop === 'ngValue' ? C : 'C'
17211721
};
17221722

17231723
var optionString = '';
@@ -1765,7 +1765,7 @@ describe('select', function() {
17651765

17661766
scope.options = [A, B, C];
17671767
scope.obj = {
1768-
value : 'C'
1768+
value: 'C'
17691769
};
17701770

17711771
var optionString = '';
@@ -2034,7 +2034,7 @@ describe('select', function() {
20342034
D.disabled = true;
20352035
scope.$digest();
20362036

2037-
var optionElements = element.find('option');
2037+
optionElements = element.find('option');
20382038
expect(optionElements.length).toEqual(4);
20392039
expect(element[0].value).toBe('');
20402040

@@ -2068,7 +2068,7 @@ describe('select', function() {
20682068

20692069
scope.options = [A, B];
20702070
scope.obj = {
2071-
value : prop === 'ngValue' ? [B, C] : ['B', 'C']
2071+
value: prop === 'ngValue' ? [B, C] : ['B', 'C']
20722072
};
20732073

20742074
var optionString = '';
@@ -2099,11 +2099,14 @@ describe('select', function() {
20992099
scope.$digest();
21002100

21012101
optionElements = element.find('option');
2102-
expect(element.val()).toEqual(prop === 'ngValue' ? [ 'object:4', 'object:5' ]: ['B', 'C']);
2102+
expect(element.val()).toEqual(prop === 'ngValue' ? ['object:4', 'object:5'] : ['B', 'C']);
21032103
expect(optionElements.length).toEqual(3);
21042104
expect(optionElements[1].selected).toBe(true);
21052105
expect(optionElements[2].selected).toBe(true);
2106-
expect(scope.obj.value).toEqual(prop === 'ngValue' ? [{ name: 'B', $$hashKey: 'object:4'}, {name: 'C', $$hashKey: 'object:5'}] : ['B', 'C']);
2106+
expect(scope.obj.value).toEqual(prop === 'ngValue' ?
2107+
[{ name: 'B', $$hashKey: 'object:4'},
2108+
{name: 'C', $$hashKey: 'object:5'}] :
2109+
['B', 'C']);
21072110
});
21082111

21092112
they('should keep selection and model when a repeated options with track by are replaced with equal options',
@@ -2117,7 +2120,7 @@ describe('select', function() {
21172120

21182121
scope.options = [A, B, C];
21192122
scope.obj = {
2120-
value : 'C'
2123+
value: 'C'
21212124
};
21222125

21232126
var optionString = '';

0 commit comments

Comments
 (0)