MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / getter

Function getter

code/songhop/www/lib/angular/angular.js:1598–1615  ·  view source on GitHub ↗
(obj, path, bindFnToScope)

Source from the content-addressed store, hash-verified

1596 */
1597//TODO(misko): this function needs to be removed
1598function getter(obj, path, bindFnToScope) {
1599 if (!path) return obj;
1600 var keys = path.split('.');
1601 var key;
1602 var lastInstance = obj;
1603 var len = keys.length;
1604
1605 for (var i = 0; i < len; i++) {
1606 key = keys[i];
1607 if (obj) {
1608 obj = (lastInstance = obj)[key];
1609 }
1610 }
1611 if (!bindFnToScope && isFunction(obj)) {
1612 return bind(lastInstance, obj);
1613 }
1614 return obj;
1615}
1616
1617/**
1618 * 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