diff --git a/src/Angular.js b/src/Angular.js index fb23e1f2..60aa0259 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -580,7 +580,41 @@ function inherit(parent, extra) { return extend(new (extend(function(){}, {prototype:parent}))(), extra); } + +/** + * @workInProgress + * @ngdoc function + * @name angular.noop + * @function + * + * @description + * Empty function that performs no operation whatsoever. This function is useful when writing code + * in the functional style. +
+ function foo(callback) {
+ var result = calculateResult();
+ (callback || angular.noop)(result);
+ }
+
+ */
function noop() {}
+
+/**
+ * @workInProgress
+ * @ngdoc function
+ * @name angular.identity
+ * @function
+ *
+ * @description
+ * A function that does nothing except for returning its first argument. This function is useful
+ * when writing code in the functional style.
+ *
+
+ function transformer(transformationFn, value) {
+ return (transformationFn || identity)(value);
+ };
+
+ */
function identity($) {return $;}
function valueFn(value) {return function(){ return value; };}