code: function addDestroyListener($scope, control, bindings, destroyed) {
          $scope.$on("$destroy", function () {
              (destroyed && destroyed());
  
              bindings.forEach(function (w) { w(); });
  
              if (control.dispose) {
                  control.dispose();
              }
          });
      }
docs: Directive utilities