Skip to content

Instantly share code, notes, and snippets.

View edm00se's full-sized avatar

Eric McCormick edm00se

View GitHub Profile
/**
* 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>
@edm00se
edm00se / snippet_localAngularFallbackFromCDN.htm
Last active August 29, 2015 14:03
AngularJS local fallback for Google CDN.
<!-- attempt to load AngularJS from CDN -->
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script>
<!-- if AngularJS fails to load fallback a local version -->
<script type="text/javascript">
if(!window.angular){
var ang = document.createElement('script');
//exlpicit path to server library copy
ang.src = "//server.com/libs/angularjs/1.2.19/angular.min.js";
// relative path