Skip to content

Instantly share code, notes, and snippets.

@fdn
Created August 13, 2015 23:10
Show Gist options
  • Save fdn/84ef0c614516aa9110f4 to your computer and use it in GitHub Desktop.
Save fdn/84ef0c614516aa9110f4 to your computer and use it in GitHub Desktop.
angular.module('appModuleName').config(function() {
'use strict';
var JQLite = angular.element;
/**
* Augment find() to support selectors
*/
var _find = JQLite.prototype.find;
JQLite.prototype.find = function(selector) {
if ((typeof selector === 'string') && (selector.indexOf('.') !== -1)) {
var element = this[0];
if (element.querySelectorAll) {
var results = element.querySelectorAll(selector);
return JQLite(results);
}
}
return _find.apply(this, arguments);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment