Search code examples
angularjssizzle

How to integrate sizzle into angular $element


Is it possible to use sizzle as selector engine for angular $element?

Our motivation is that Angular jQuery Lite does everything we need except the dom queries for IE 8+.
An example might be:

angular.element('ul[some=example]').find('input:text')

Or should we rather use a custom jQuery build?


Solution

  • AngularJS .element() implementation returns a jQLite object (or jQuery object) depending on what is available, but it doesn't support jQuery's Sizzle implementation.

    In other words, angular.element() is for creating elements rather than finding elements.