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

Function getter

test/angular/1.3/angular.js:1624–1641  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

1622 */
1623//TODO(misko): this function needs to be removed
1624function getter(obj, path, bindFnToScope) {
1625 if (!path) return obj;
1626 var keys = path.split('.');
1627 var key;
1628 var lastInstance = obj;
1629 var len = keys.length;
1630
1631 for (var i = 0; i < len; i++) {
1632 key = keys[i];
1633 if (obj) {
1634 obj = (lastInstance = obj)[key];
1635 }
1636 }
1637 if (!bindFnToScope && isFunction(obj)) {
1638 return bind(lastInstance, obj);
1639 }
1640 return obj;
1641}
1642
1643/**
1644 * 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