Famous / famous-angular

Bring structure to your Famo.us apps with the power of AngularJS. Famo.us/Angular integrates seamlessly with existing Angular and Famo.us apps.
https://famo.us/angular
Mozilla Public License 2.0
1.92k stars 275 forks source link

Fix: IsASurface/IsFaElement when JQuery element selector returns empty set #258

Closed hannahhoward closed 9 years ago

hannahhoward commented 9 years ago

These two methods always work if the app just uses JQLite, which can only select elements by tagName. However, if an app uses full Jquery, a selector may return no elements with no associated tagName (i.e. angular.element('.class-selector-with-no-matched-elements') ), at which point these methods throw a JS error. This just inserts a check to see if the element even exists at all, and returns false if not.

This actually came up in our app which does use JQuery and prevented the loading of another JQuery library.