(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<!-- Conditionally load WC polyfills --> | |
<script> | |
if ('registerElement' in document | |
&& 'createShadowRoot' in HTMLElement.prototype | |
&& 'import' in document.createElement('link') | |
&& 'content' in document.createElement('template')) { | |
// We're using a browser with native WC support! | |
} else { | |
document.write('<script src="/bower_components/webcomponentsjs/webcomponents.js"><\/script>'); | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/** | |
* 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> |
/* | |
Chrome does not let you modify the keyCode prop when you trigger it, so it defaults to 0. | |
You can use this code to trigger a keydown with a char code of 0 in chrome. | |
If you use initKeyEvent instead of initKeyboardEvent, it will work in FF | |
(the bellow example would trigger keydown with a char code of 65 in FF). | |
*/ | |
document.addEventListener( 'keydown', function( event ){ | |
console.log( event.keyCode ) |