This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app', []).directive('ngDebounce', function($timeout) { | |
return { | |
restrict: 'A', | |
require: 'ngModel', | |
priority: 99, | |
link: function(scope, elm, attr, ngModelCtrl) { | |
if (attr.type === 'radio' || attr.type === 'checkbox') return; | |
elm.unbind('input'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Snippet function to load external scripts. | |
* @param {[String, Array]} sources Array of sources to load. | |
* @param {[Functon]} callback A callback to run when all scripts have loaded. | |
* @param {[Boolean]} aasync Whether sources should be loaded | |
* asynchronously or not. | |
* @param {[Object]} appendTo Optionally provide a DOM object to append | |
* the script tags to. | |
*/ | |
function scriptLoader(sources, callback, async, appendTo) { |