Skip to content

Commit f82e135

Browse files
committed
refactor(ngList): access ngList attribute directly
The original way is not necessary since $compile doesn't remove white-space anymore
1 parent 47724ba commit f82e135

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/ng/directive/ngList.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ var ngListDirective = function() {
9191
priority: 100,
9292
require: 'ngModel',
9393
link: function(scope, element, attr, ctrl) {
94-
// We want to control whitespace trimming so we use this convoluted approach
95-
// to access the ngList attribute, which doesn't pre-trim the attribute
96-
var ngList = element.attr(attr.$attr.ngList) || ', ';
94+
var ngList = attr.ngList || ', ';
9795
var trimValues = attr.ngTrim !== 'false';
9896
var separator = trimValues ? trim(ngList) : ngList;
9997

test/ng/directive/ngListSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe('ngList', function() {
135135
helper.compileInput('<textarea type="text" ng-model="list" ng-trim="false" ng-list=" "></textarea>');
136136
helper.changeInputValueTo('a b');
137137
expect($rootScope.list).toEqual(['a','b']);
138-
})
138+
});
139139
});
140140
});
141141

0 commit comments

Comments
 (0)