code: function bindFocusBlur(element, inputElement) {
          var isFocused, isMousedown, isBlur;
  
          $document[0].addEventListener('click', clickHandler, true);
          element[0].addEventListener('mousedown', mousedownHandler, true);
          element[0].addEventListener('blur', blurHandler, true);
          inputElement.on('focus', focusHandler);
  
          function blurHandler(event) {
              if (event && event.target.nodeName !== 'INPUT') return; //for IE
  
              isBlur = false;
  
              if (isMousedown) {
                  isBlur = true;
                  return;
              }
  
              $timeout(function () {
                  element.triggerHandler('blur'); //conflict with current live cycle (case: multiple=none + tab)
              });
          }
  
          function focusHandler() {
              if (!isFocused) {
                  isFocused = true;
  
                  $timeout(function () {
                      element.triggerHandler('focus'); //conflict with current live cycle (case: multiple=none + tab)
                  });
              }
          }
  
          function mousedownHandler() {
              isMousedown = true;
          }
  
          function clickHandler(event) {
              isMousedown = false;
  
              var activeElement = event.target;
              var isSelectElement = contains(element[0], activeElement);
  
              if (isBlur && !isSelectElement) {
                  blurHandler();
              }
  
              if (isSelectElement && activeElement.nodeName !== 'INPUT') {
                  $timeout(function () {
                      inputElement[0].focus();
                  });
              }
  
              if (!isSelectElement && isFocused) {
                  isFocused = false;
              }
          }
  
          return function () {
              $document[0].removeEventListener('click', clickHandler, true);
              element[0].removeEventListener('mousedown', mousedownHandler, true);
              element[0].removeEventListener('blur', blurHandler, true);
              inputElement.off('focus', focusHandler);
          }
      }
docs: Simulate focus/blur events of the inner input element to the outer element
  
  @param {element} outer element
  @param {element} inner input element
  @returns {function} deregistration function for listeners.