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

Function getter

test/angular/1.2/angular.js:1545–1562  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

1543 */
1544//TODO(misko): this function needs to be removed
1545function getter(obj, path, bindFnToScope) {
1546 if (!path) return obj;
1547 var keys = path.split('.');
1548 var key;
1549 var lastInstance = obj;
1550 var len = keys.length;
1551
1552 for (var i = 0; i < len; i++) {
1553 key = keys[i];
1554 if (obj) {
1555 obj = (lastInstance = obj)[key];
1556 }
1557 }
1558 if (!bindFnToScope && isFunction(obj)) {
1559 return bind(lastInstance, obj);
1560 }
1561 return obj;
1562}
1563
1564/**
1565 * 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