aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng')
-rw-r--r--src/ng/anchorScroll.js7
-rw-r--r--src/ng/compile.js6
-rw-r--r--src/ng/directive/booleanAttrs.js2
-rw-r--r--src/ng/directive/input.js4
-rw-r--r--src/ng/directive/ngBind.js4
-rw-r--r--src/ng/directive/ngClass.js6
-rw-r--r--src/ng/directive/ngInclude.js2
-rw-r--r--src/ng/directive/ngPluralize.js4
-rw-r--r--src/ng/directive/ngRepeat.js6
-rw-r--r--src/ng/directive/ngShowHide.js4
-rw-r--r--src/ng/directive/ngStyle.js2
-rw-r--r--src/ng/directive/ngSwitch.js2
-rw-r--r--src/ng/directive/select.js4
13 files changed, 27 insertions, 26 deletions
diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js
index ecaa62e0..87867589 100644
--- a/src/ng/anchorScroll.js
+++ b/src/ng/anchorScroll.js
@@ -55,9 +55,10 @@ function $AnchorScrollProvider() {
// does not scroll when user clicks on anchor link that is currently on
// (no url change, no $locaiton.hash() change), browser native does scroll
if (autoScrollingEnabled) {
- $rootScope.$watch(function() {return $location.hash();}, function() {
- $rootScope.$evalAsync(scroll);
- });
+ $rootScope.$watch(function autoScrollWatch() {return $location.hash();},
+ function autoScrollWatchAction() {
+ $rootScope.$evalAsync(scroll);
+ });
}
return scroll;
diff --git a/src/ng/compile.js b/src/ng/compile.js
index a569ca8e..ccdd1880 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -737,7 +737,7 @@ function $CompileProvider($provide) {
' (directive: ' + newScopeDirective.name + ')');
};
lastValue = scope[scopeName] = parentGet(parentScope);
- scope.$watch(function() {
+ scope.$watch(function parentValueWatch() {
var parentValue = parentGet(parentScope);
if (parentValue !== scope[scopeName]) {
@@ -996,7 +996,7 @@ function $CompileProvider($provide) {
bindings = parent.data('$binding') || [];
bindings.push(interpolateFn);
safeAddClass(parent.data('$binding', bindings), 'ng-binding');
- scope.$watch(interpolateFn, function(value) {
+ scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
node[0].nodeValue = value;
});
})
@@ -1026,7 +1026,7 @@ function $CompileProvider($provide) {
attr[name] = undefined;
($$observers[name] || ($$observers[name] = [])).$$inter = true;
(attr.$$observers && attr.$$observers[name].$$scope || scope).
- $watch(interpolateFn, function(value) {
+ $watch(interpolateFn, function interpolateFnWatchAction(value) {
attr.$set(name, value);
});
})
diff --git a/src/ng/directive/booleanAttrs.js b/src/ng/directive/booleanAttrs.js
index 2cc26ce7..8902c35d 100644
--- a/src/ng/directive/booleanAttrs.js
+++ b/src/ng/directive/booleanAttrs.js
@@ -284,7 +284,7 @@ forEach(BOOLEAN_ATTR, function(propName, attrName) {
priority: 100,
compile: function() {
return function(scope, element, attr) {
- scope.$watch(attr[normalized], function(value) {
+ scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
attr.$set(attrName, !!value);
});
};
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js
index cd2f0cfc..2fba7e92 100644
--- a/src/ng/directive/input.js
+++ b/src/ng/directive/input.js
@@ -995,7 +995,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
// model -> value
var ctrl = this;
- $scope.$watch(ngModelGet, function(value) {
+ $scope.$watch(ngModelGet, function ngModelWatchAction(value) {
// ignore change from view
if (ctrl.$modelValue === value) return;
@@ -1242,7 +1242,7 @@ var ngValueDirective = function() {
};
} else {
return function(scope, elm, attr) {
- scope.$watch(attr.ngValue, function(value) {
+ scope.$watch(attr.ngValue, function valueWatchAction(value) {
attr.$set('value', value, false);
});
};
diff --git a/src/ng/directive/ngBind.js b/src/ng/directive/ngBind.js
index 70f25370..0c99f27d 100644
--- a/src/ng/directive/ngBind.js
+++ b/src/ng/directive/ngBind.js
@@ -49,7 +49,7 @@
*/
var ngBindDirective = ngDirective(function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBind);
- scope.$watch(attr.ngBind, function(value) {
+ scope.$watch(attr.ngBind, function ngBindWatchAction(value) {
element.text(value == undefined ? '' : value);
});
});
@@ -132,7 +132,7 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
var ngBindHtmlUnsafeDirective = [function() {
return function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBindHtmlUnsafe);
- scope.$watch(attr.ngBindHtmlUnsafe, function(value) {
+ scope.$watch(attr.ngBindHtmlUnsafe, function ngBindHtmlUnsafeWatchAction(value) {
element.html(value || '');
});
};
diff --git a/src/ng/directive/ngClass.js b/src/ng/directive/ngClass.js
index 6ba73e60..13b0378a 100644
--- a/src/ng/directive/ngClass.js
+++ b/src/ng/directive/ngClass.js
@@ -4,7 +4,7 @@ function classDirective(name, selector) {
name = 'ngClass' + name;
return ngDirective(function(scope, element, attr) {
// Reusable function for re-applying the ngClass
- function reapply(newVal, oldVal) {
+ function ngClassWatchAction(newVal, oldVal) {
if (selector === true || scope.$index % 2 === selector) {
if (oldVal && (newVal !== oldVal)) {
if (isObject(oldVal) && !isArray(oldVal))
@@ -16,11 +16,11 @@ function classDirective(name, selector) {
if (newVal) element.addClass(isArray(newVal) ? newVal.join(' ') : newVal);
}
};
- scope.$watch(attr[name], reapply, true);
+ scope.$watch(attr[name], ngClassWatchAction, true);
attr.$observe('class', function(value) {
var ngClass = scope.$eval(attr[name]);
- reapply(ngClass, ngClass);
+ ngClassWatchAction(ngClass, ngClass);
});
});
}
diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js
index 26107206..d4eacbe3 100644
--- a/src/ng/directive/ngInclude.js
+++ b/src/ng/directive/ngInclude.js
@@ -101,7 +101,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
element.html('');
};
- scope.$watch(srcExp, function(src) {
+ scope.$watch(srcExp, function ngIncludeWatchAction(src) {
var thisChangeId = ++changeCounter;
if (src) {
diff --git a/src/ng/directive/ngPluralize.js b/src/ng/directive/ngPluralize.js
index d9327b82..3938d4e3 100644
--- a/src/ng/directive/ngPluralize.js
+++ b/src/ng/directive/ngPluralize.js
@@ -188,7 +188,7 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
offset + endSymbol));
});
- scope.$watch(function() {
+ scope.$watch(function ngPluralizeWatch() {
var value = parseFloat(scope.$eval(numberExp));
if (!isNaN(value)) {
@@ -199,7 +199,7 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
} else {
return '';
}
- }, function(newVal) {
+ }, function ngPluralizeWatchAction(newVal) {
element.text(newVal);
});
}
diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js
index a47b7abc..021845fa 100644
--- a/src/ng/directive/ngRepeat.js
+++ b/src/ng/directive/ngRepeat.js
@@ -89,7 +89,7 @@ var ngRepeatDirective = ngDirective({
// We expect this to be a rare case.
var lastOrder = new HashQueueMap();
var indexValues = [];
- scope.$watch(function(scope){
+ scope.$watch(function ngRepeatWatch(scope){
var index, length,
collection = scope.$eval(rhs),
collectionLength = size(collection, true),
@@ -131,7 +131,7 @@ var ngRepeatDirective = ngDirective({
} else {
last = undefined;
}
-
+
if (last) {
// if we have already seen this object, then we need to reuse the
// associated scope/element
@@ -187,7 +187,7 @@ var ngRepeatDirective = ngDirective({
for (i = 0, l = indexValues.length - length; i < l; i++) {
indexValues.pop();
}
-
+
//shrink children
for (key in lastOrder) {
if (lastOrder.hasOwnProperty(key)) {
diff --git a/src/ng/directive/ngShowHide.js b/src/ng/directive/ngShowHide.js
index e381c1b7..cba6cc89 100644
--- a/src/ng/directive/ngShowHide.js
+++ b/src/ng/directive/ngShowHide.js
@@ -34,7 +34,7 @@
*/
//TODO(misko): refactor to remove element from the DOM
var ngShowDirective = ngDirective(function(scope, element, attr){
- scope.$watch(attr.ngShow, function(value){
+ scope.$watch(attr.ngShow, function ngShowWatchAction(value){
element.css('display', toBoolean(value) ? '' : 'none');
});
});
@@ -74,7 +74,7 @@ var ngShowDirective = ngDirective(function(scope, element, attr){
*/
//TODO(misko): refactor to remove element from the DOM
var ngHideDirective = ngDirective(function(scope, element, attr){
- scope.$watch(attr.ngHide, function(value){
+ scope.$watch(attr.ngHide, function ngHideWatchAction(value){
element.css('display', toBoolean(value) ? 'none' : '');
});
});
diff --git a/src/ng/directive/ngStyle.js b/src/ng/directive/ngStyle.js
index 5b0a3728..a1c2b699 100644
--- a/src/ng/directive/ngStyle.js
+++ b/src/ng/directive/ngStyle.js
@@ -38,7 +38,7 @@
</example>
*/
var ngStyleDirective = ngDirective(function(scope, element, attr) {
- scope.$watch(attr.ngStyle, function(newStyles, oldStyles) {
+ scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {
if (oldStyles && (newStyles !== oldStyles)) {
forEach(oldStyles, function(val, style) { element.css(style, '');});
}
diff --git a/src/ng/directive/ngSwitch.js b/src/ng/directive/ngSwitch.js
index 7d4cc192..0c9e2a8d 100644
--- a/src/ng/directive/ngSwitch.js
+++ b/src/ng/directive/ngSwitch.js
@@ -72,7 +72,7 @@ var ngSwitchDirective = valueFn({
selectedElement,
selectedScope;
- scope.$watch(watchExpr, function(value) {
+ scope.$watch(watchExpr, function ngSwitchWatchAction(value) {
if (selectedElement) {
selectedScope.$destroy();
selectedElement.remove();
diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js
index 77b2f46d..0c94ddcb 100644
--- a/src/ng/directive/select.js
+++ b/src/ng/directive/select.js
@@ -269,7 +269,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
// we have to do it on each watch since ngModel watches reference, but
// we need to work of an array, so we need to see if anything was inserted/removed
- scope.$watch(function() {
+ scope.$watch(function selectMultipleWatch() {
if (!equals(lastView, ctrl.$viewValue)) {
lastView = copy(ctrl.$viewValue);
ctrl.$render();
@@ -544,7 +544,7 @@ var optionDirective = ['$interpolate', function($interpolate) {
}
if (interpolateFn) {
- scope.$watch(interpolateFn, function(newVal, oldVal) {
+ scope.$watch(interpolateFn, function interpolateWatchAction(newVal, oldVal) {
attr.$set('value', newVal);
if (newVal !== oldVal) selectCtrl.removeOption(oldVal);
selectCtrl.addOption(newVal);