angular-draganddrop.js
function getData(event) {
        var types = toArray(event.dataTransfer.types);

        return types.reduce(function (collection, type) {
          // Get data.
          var data = event.dataTransfer.getData(type);

          // Get data format.
          var format = /(.*)\//.exec(type);
          format = format ? format[1] : null;

          // Parse data.
          if (format === 'json') data = JSON.parse(data);

          collection[type] = data;

          return collection;
        }, {});
      }
function getData(event) {
        var types = toArray(event.dataTransfer.types);

        return types.reduce(function (collection, type) {
          // Get data.
          var data = event.dataTransfer.getData(type);

          // Get data format.
          var format = /(.*)\//.exec(type);
          format = format ? format[1] : null;

          // Parse data.
          if (format === 'json') data = JSON.parse(data);

          collection[type] = data;

          return collection;
        }, {});
      }
function getData ( event ) { var types = toArray ( event . dataTransfer . types ) ; return types . reduce ( function ( collection , type ) { // Get data. var data = event . dataTransfer . getData ( type ) ; // Get data format. var format = / (.*)\/ / . exec ( type ) ; format = format ? format [ 1 ] : null ; // Parse data. if ( format === 'json' ) data = JSON . parse ( data ) ; collection [ type ] = data ; return collection ; } , { } ) ; }
Get data from a drag event.

@param {Event} event
@returns {Object}
Get data from a drag event .