code: function activateResizing() {
          var debouncedOnResize = (function(scope, target, options) {
  
            return function() {
              if (options.isRemoved) return;
  
              var updates = calculateMenuPositions(scope, target, options);
              var container = updates.container;
              var dropDown = updates.dropDown;
  
              container.element.css(animator.toCss(container.styles));
              dropDown.element.css(animator.toCss(dropDown.styles));
            };
  
          })(scope, element, opts);
  
          var window = angular.element($window);
          window.on('resize', debouncedOnResize);
          window.on('orientationchange', debouncedOnResize);
  
          // Publish deactivation closure...
          return function deactivateResizing() {
  
            // Disable resizing handlers
            window.off('resize', debouncedOnResize);
            window.off('orientationchange', debouncedOnResize);
          };
        }
docs: Configure various resize listeners for screen changes