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

Function getter

lib/test/angular/1.4.3/angular.js:1804–1821  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

1802 */
1803//TODO(misko): this function needs to be removed
1804function getter(obj, path, bindFnToScope) {
1805 if (!path) return obj;
1806 var keys = path.split('.');
1807 var key;
1808 var lastInstance = obj;
1809 var len = keys.length;
1810
1811 for (var i = 0; i < len; i++) {
1812 key = keys[i];
1813 if (obj) {
1814 obj = (lastInstance = obj)[key];
1815 }
1816 }
1817 if (!bindFnToScope && isFunction(obj)) {
1818 return bind(lastInstance, obj);
1819 }
1820 return obj;
1821}
1822
1823/**
1824 * Return the DOM siblings between the first and last node in the given array.

Callers 3

$ControllerProviderFunction · 0.70
GridRowColumn.jsFile · 0.50
ui-i18n.jsFile · 0.50

Calls 2

isFunctionFunction · 0.70
bindFunction · 0.70

Tested by

no test coverage detected