MCPcopy Create free account
hub / github.com/apache/cloudstack / getter

Function getter

tools/ngui/static/js/lib/angular.js:6438–6455  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

6436 */
6437//TODO(misko): this function needs to be removed
6438function getter(obj, path, bindFnToScope) {
6439 if (!path) return obj;
6440 var keys = path.split('.');
6441 var key;
6442 var lastInstance = obj;
6443 var len = keys.length;
6444
6445 for (var i = 0; i < len; i++) {
6446 key = keys[i];
6447 if (obj) {
6448 obj = (lastInstance = obj)[key];
6449 }
6450 }
6451 if (!bindFnToScope && isFunction(obj)) {
6452 return bind(lastInstance, obj);
6453 }
6454 return obj;
6455}
6456
6457var getterFnCache = {};
6458

Callers 4

$ControllerProviderFunction · 0.85
readIdentFunction · 0.85
_fieldAccessFunction · 0.85
filterFilterFunction · 0.85

Calls 2

isFunctionFunction · 0.85
bindFunction · 0.85

Tested by

no test coverage detected