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

Commit 28728a9

Browse files
committed
refactor(ngAria): DRY camelcase method
remove the camelCase function and use the one from the public API
1 parent 3ee771a commit 28728a9

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/ngAria/aria.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,8 @@ function $AriaProvider() {
109109
config = angular.extend(config, newConfig);
110110
};
111111

112-
function camelCase(input) {
113-
return input.replace(/-./g, function(letter, pos) {
114-
return letter[1].toUpperCase();
115-
});
116-
}
117-
118-
119112
function watchExpr(attrName, ariaAttr, negate) {
120-
var ariaCamelName = camelCase(ariaAttr);
113+
var ariaCamelName = angular.camelcase(ariaAttr);
121114
return function(scope, elem, attr) {
122115
if (config[ariaCamelName] && !attr[ariaCamelName]) {
123116
scope.$watch(attr[attrName], function(boolVal) {
@@ -178,7 +171,7 @@ function $AriaProvider() {
178171
this.$get = function() {
179172
return {
180173
config: function(key) {
181-
return config[camelCase(key)];
174+
return config[angular.camelcase(key)];
182175
},
183176
$$watchExpr: watchExpr
184177
};

0 commit comments

Comments
 (0)