Skip to content

Instantly share code, notes, and snippets.

@compact
compact / dropzone-directive.js
Last active March 16, 2024 02:55
AngularJS directive for Dropzone.js
/**
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/
*
* Usage:
*
* <div ng-app="app" ng-controller="SomeCtrl">
* <button dropzone="dropzoneConfig">
* Drag and drop files here or click to upload
* </button>
* </div>
@compact
compact / custom-event-handling.js
Created October 15, 2013 12:30
Basic custom event handling without having to use the DOM Event Model. Uses Underscore.js or Lo-Dash.
var events = (function (events, _) {
'use strict';
// keys are event names
var handlers = {};
/**
* Bind the given handler to the given event.
* @param {String} event
* @param {Function} handler