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

Function getter

test/angular/1.5/angular.js:1977–1994  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

1975 */
1976//TODO(misko): this function needs to be removed
1977function getter(obj, path, bindFnToScope) {
1978 if (!path) return obj;
1979 var keys = path.split('.');
1980 var key;
1981 var lastInstance = obj;
1982 var len = keys.length;
1983
1984 for (var i = 0; i < len; i++) {
1985 key = keys[i];
1986 if (obj) {
1987 obj = (lastInstance = obj)[key];
1988 }
1989 }
1990 if (!bindFnToScope && isFunction(obj)) {
1991 return bind(lastInstance, obj);
1992 }
1993 return obj;
1994}
1995
1996/**
1997 * 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