aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChirayu Krishnappa2013-06-24 20:45:31 -0700
committerBrian Ford2013-08-12 16:23:39 -0700
commit099138fb9a94178d3d82568fbda28d0c87443de9 (patch)
tree0c3db9f99789722d9047947858beb57f84b19344 /src
parentcbe31d8dfd12ce973c574bfc825ffc0ffb8eb7c4 (diff)
downloadangular.js-099138fb9a94178d3d82568fbda28d0c87443de9.tar.bz2
fix($parse): move global getter out of parse.js
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js27
-rw-r--r--src/ng/parse.js27
2 files changed, 27 insertions, 27 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 467af4ce..475c0585 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -1104,3 +1104,30 @@ function assertArgFn(arg, name, acceptArrayAnnotation) {
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
return arg;
}
+
+/**
+ * Return the value accessible from the object by path. Any undefined traversals are ignored
+ * @param {Object} obj starting object
+ * @param {string} path path to traverse
+ * @param {boolean=true} bindFnToScope
+ * @returns value as accessible by path
+ */
+//TODO(misko): this function needs to be removed
+function getter(obj, path, bindFnToScope) {
+ if (!path) return obj;
+ var keys = path.split('.');
+ var key;
+ var lastInstance = obj;
+ var len = keys.length;
+
+ for (var i = 0; i < len; i++) {
+ key = keys[i];
+ if (obj) {
+ obj = (lastInstance = obj)[key];
+ }
+ }
+ if (!bindFnToScope && isFunction(obj)) {
+ return bind(lastInstance, obj);
+ }
+ return obj;
+}
diff --git a/src/ng/parse.js b/src/ng/parse.js
index 86ac8806..1a2d10c4 100644
--- a/src/ng/parse.js
+++ b/src/ng/parse.js
@@ -663,33 +663,6 @@ function setter(obj, path, setValue) {
return setValue;
}
-/**
- * Return the value accesible from the object by path. Any undefined traversals are ignored
- * @param {Object} obj starting object
- * @param {string} path path to traverse
- * @param {boolean=true} bindFnToScope
- * @returns value as accesbile by path
- */
-//TODO(misko): this function needs to be removed
-function getter(obj, path, bindFnToScope) {
- if (!path) return obj;
- var keys = path.split('.');
- var key;
- var lastInstance = obj;
- var len = keys.length;
-
- for (var i = 0; i < len; i++) {
- key = keys[i];
- if (obj) {
- obj = (lastInstance = obj)[key];
- }
- }
- if (!bindFnToScope && isFunction(obj)) {
- return bind(lastInstance, obj);
- }
- return obj;
-}
-
var getterFnCache = {};
/**