code: function offset(elem) {
              elem = getRawNode(elem);
  
              var elemBCR = elem.getBoundingClientRect();
              return {
                  width: Math.round(
                      Angular.isNumber(elemBCR.width)
                          ? elemBCR.width
                          : elem.offsetWidth
                  ),
                  height: Math.round(
                      Angular.isNumber(elemBCR.height)
                          ? elemBCR.height
                          : elem.offsetHeight
                  ),
                  top: Math.round(
                      elemBCR.top +
                          ($window.pageYOffset ||
                              $document[0].documentElement.scrollTop)
                  ),
                  left: Math.round(
                      elemBCR.left +
                          ($window.pageXOffset ||
                              $document[0].documentElement.scrollLeft)
                  ),
              };
          }
docs: Source: https://github.com/angular-ui/bootstrap/blob/master/src/position/position.js