MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / getter

Function getter

lib/test/angular/1.7.0/angular.js:2091–2108  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

2089 */
2090//TODO(misko): this function needs to be removed
2091function getter(obj, path, bindFnToScope) {
2092 if (!path) return obj;
2093 var keys = path.split('.');
2094 var key;
2095 var lastInstance = obj;
2096 var len = keys.length;
2097
2098 for (var i = 0; i < len; i++) {
2099 key = keys[i];
2100 if (obj) {
2101 obj = (lastInstance = obj)[key];
2102 }
2103 }
2104 if (!bindFnToScope && isFunction(obj)) {
2105 return bind(lastInstance, obj);
2106 }
2107 return obj;
2108}
2109
2110/**
2111 * Return the DOM siblings between the first and last node in the given array.

Callers 1

$ControllerProviderFunction · 0.70

Calls 2

isFunctionFunction · 0.70
bindFunction · 0.70

Tested by

no test coverage detected