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

Remove jQuery dependency #10

Closed graunked closed 10 years ago

graunked commented 10 years ago

Creating a fa-app without jQuery included throws ReferenceError: $ is not defined at line 20 of fa-app. Can we do without jQuery?

ocombe commented 10 years ago

It's possible, you just have to use angular functions (with jquery lite). Not all jquery functions are available but the main ones are, and you can use vanilla js for the rest. I'll take a look.

zackbrown commented 10 years ago

Looked at this briefly a little while back. Per https://docs.angularjs.org/api/ng/function/angular.element, one of jqLite's limitations is find() - Limited to lookups by tag name. As I recall, that was the stopping block--we use find a handful of places throughout the code. Certainly fixable, but I figured low enough priority for now-- @ocombe , if you can extricate the jQuery dependency, that'd be awesome (but again, maybe not top priority at the moment.) One key place to watch out for is the animation api, which supports assigning animations to modifiers by selectors.

Hendrixer commented 10 years ago

We can use window.document.querySelector() instead of find()

ocombe commented 10 years ago

Yes, it won't work on IE7 but neither do angular nor famous anyway.

ocombe commented 10 years ago

Ok I have a version jquery-underscore-free ready, but I'll wait for you to accept my other PR before :)

ocombe commented 10 years ago

See PR #35 !

zackbrown commented 10 years ago

woot!