code: function resetUpDragDrop() {
          // Add an index to the sortable to allow sorting of the
          // underlying data.
          const children = element.children();
          for (let i = 0; i < children.length; ++i) {
            angular.element(children[i]).data('idx', i);
          }
  
          const sortableElement = $(element);
  
          // the element is already sortable; reset it.
          if (sortableElement.data('ui-sortable')) {
            sortableElement.off('sortupdate');
            sortableElement.sortable('destroy');
          }
  
          const sortableOptions = {
            'axis': 'y',
            'classes': {
              'ui-sortable-helper': options['draggerClassName']
            }
          };
  
          // CSS class of the handle
          if (options['handleClassName']) {
            sortableOptions['handle'] = `.${options['handleClassName']}`;
          }
  
          // Placeholder for the item being dragged in the sortable list
          if (options['placeholderClassName']) {
            sortableOptions['placeholder'] = options['placeholderClassName'];
            sortableOptions['forcePlaceholderSize'] = true;
          }
  
          sortableElement.sortable(sortableOptions);
  
          // This event is triggered when the user stopped sorting and
          // the DOM position (i.e. order in the sortable list) has changed.
          sortableElement.on('sortupdate', (event, ui) => {
            const oldIndex = $(ui.item[0]).data('idx');
            const newIndex = ui.item.index();
  
            // Update (data)-index on dom element to its new position
            $(ui.item[0]).data('idx', newIndex);
  
            // Move dragged item to new position
            scope.$apply(() => {
              sortable.splice(newIndex, 0, sortable.splice(oldIndex, 1)[0]);
            });
  
            // Call the callback function if it exists.
            if (callbackFn instanceof Function) {
              callbackFn.apply(callbackCtx, [element, sortable]);
            }
          });
        }
docs: This function resets drag&drop for the list. It is called each
  time the sortable array changes (see $watchCollection above).