diff options
| author | Igor Minar | 2011-01-07 22:02:23 -0800 |
|---|---|---|
| committer | Igor Minar | 2011-01-10 10:26:55 -0800 |
| commit | 0a6cf70debc6440685af3f9ea96a66450e4f4ed7 (patch) | |
| tree | 3b7e82bedf53960deb5d460532779ec449dd8dfc /src/widgets.js | |
| parent | c79aba92f6b058742c9ae20a9382f6abc68afcea (diff) | |
| download | angular.js-0a6cf70debc6440685af3f9ea96a66450e4f4ed7.tar.bz2 | |
Rename angular.foreach to angular.forEach to make the api consistent.
camelcase is used for other angular functions and forEach is also
used by EcmaScript standard.
- rename the internal as well as the external function name
- tweak the implementation of the function so that it doesn't
clober it self when we extend the angular object with an
object that has a forEach property equal to this forEach function
Closes #85
Diffstat (limited to 'src/widgets.js')
| -rw-r--r-- | src/widgets.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets.js b/src/widgets.js index 5ff4a28f..5f159990 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -359,15 +359,15 @@ function optionsAccessor(scope, element) { return { get: function(){ var values = []; - foreach(options, function(option){ + forEach(options, function(option){ if (option.selected) values.push(option.value); }); return values; }, set: function(values){ var keys = {}; - foreach(values, function(value){ keys[value] = true; }); - foreach(options, function(option){ + forEach(values, function(value){ keys[value] = true; }); + forEach(options, function(option){ option.selected = keys[option.value]; }); } @@ -698,7 +698,7 @@ var ngSwitch = angularWidget('ng:switch', function (element){ if (isString(when)) { switchCase.when = function(scope, value){ var args = [value, when]; - foreach(usingExprParams, function(arg){ + forEach(usingExprParams, function(arg){ args.push(arg); }); return usingFn.apply(scope, args); @@ -711,7 +711,7 @@ var ngSwitch = angularWidget('ng:switch', function (element){ }); // this needs to be here for IE - foreach(cases, function(_case){ + forEach(cases, function(_case){ _case.element.remove(); }); @@ -722,7 +722,7 @@ var ngSwitch = angularWidget('ng:switch', function (element){ var found = false; element.html(''); childScope = createScope(scope); - foreach(cases, function(switchCase){ + forEach(cases, function(switchCase){ if (!found && switchCase.when(childScope, value)) { found = true; var caseElement = quickClone(switchCase.element); |
