code: function handleResizeWhenVisible () {
      // if there is already a watcher waiting for resize, do nothing
      if (handleResizeWhenVisible.watcher) return;
      // otherwise, we will abuse the $watch function to check for visible
      handleResizeWhenVisible.watcher = $scope.$watch(function () {
        // since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates
        $mdUtil.nextTick(function () {
          // if the watcher has already run (ie. multiple digests in one cycle), do nothing
          if (!handleResizeWhenVisible.watcher) return;
  
          if ($element.prop('offsetParent')) {
            handleResizeWhenVisible.watcher();
            handleResizeWhenVisible.watcher = null;
  
            handleWindowResize();
          }
        }, false);
      });
    }
docs: Queues up a call to `handleWindowResize` when a resize occurs while the tabs component is
  hidden.