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

Function getter

lib/test/angular/1.6.7/angular.js:2123–2140  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

2121 */
2122//TODO(misko): this function needs to be removed
2123function getter(obj, path, bindFnToScope) {
2124 if (!path) return obj;
2125 var keys = path.split('.');
2126 var key;
2127 var lastInstance = obj;
2128 var len = keys.length;
2129
2130 for (var i = 0; i < len; i++) {
2131 key = keys[i];
2132 if (obj) {
2133 obj = (lastInstance = obj)[key];
2134 }
2135 }
2136 if (!bindFnToScope && isFunction(obj)) {
2137 return bind(lastInstance, obj);
2138 }
2139 return obj;
2140}
2141
2142/**
2143 * 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