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

Function getter

lib/test/angular/1.5.0/angular.js:1859–1876  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

1857 */
1858//TODO(misko): this function needs to be removed
1859function getter(obj, path, bindFnToScope) {
1860 if (!path) return obj;
1861 var keys = path.split('.');
1862 var key;
1863 var lastInstance = obj;
1864 var len = keys.length;
1865
1866 for (var i = 0; i < len; i++) {
1867 key = keys[i];
1868 if (obj) {
1869 obj = (lastInstance = obj)[key];
1870 }
1871 }
1872 if (!bindFnToScope && isFunction(obj)) {
1873 return bind(lastInstance, obj);
1874 }
1875 return obj;
1876}
1877
1878/**
1879 * 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