MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / getter

Function getter

OpenReservation/wwwroot/Scripts/angular.js:1843–1860  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

1841 */
1842 //TODO(misko): this function needs to be removed
1843 function getter(obj, path, bindFnToScope) {
1844 if (!path) return obj;
1845 var keys = path.split('.');
1846 var key;
1847 var lastInstance = obj;
1848 var len = keys.length;
1849
1850 for (var i = 0; i < len; i++) {
1851 key = keys[i];
1852 if (obj) {
1853 obj = (lastInstance = obj)[key];
1854 }
1855 }
1856 if (!bindFnToScope && isFunction(obj)) {
1857 return bind(lastInstance, obj);
1858 }
1859 return obj;
1860 }
1861
1862 /**
1863 * Return the DOM siblings between the first and last node in the given array.

Callers 2

jquery-1.10.2.jsFile · 0.85
$ControllerProviderFunction · 0.85

Calls 2

isFunctionFunction · 0.85
bindFunction · 0.85

Tested by

no test coverage detected