MCPcopy
hub / github.com/angular-ui/ui-grid / getter

Function getter

lib/test/angular/1.8.0/angular.js:2151–2168  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

2149 */
2150//TODO(misko): this function needs to be removed
2151function getter(obj, path, bindFnToScope) {
2152 if (!path) return obj;
2153 var keys = path.split('.');
2154 var key;
2155 var lastInstance = obj;
2156 var len = keys.length;
2157
2158 for (var i = 0; i < len; i++) {
2159 key = keys[i];
2160 if (obj) {
2161 obj = (lastInstance = obj)[key];
2162 }
2163 }
2164 if (!bindFnToScope && isFunction(obj)) {
2165 return bind(lastInstance, obj);
2166 }
2167 return obj;
2168}
2169
2170/**
2171 * Return the DOM siblings between the first and last node in the given array.

Callers 2

$ControllerProviderFunction · 0.70
angular.jsFile · 0.70

Calls 2

isFunctionFunction · 0.70
bindFunction · 0.70

Tested by

no test coverage detected