Created
August 13, 2015 23:10
-
-
Save fdn/84ef0c614516aa9110f4 to your computer and use it in GitHub Desktop.
This file contains 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('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