Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jQuery dependency #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

s9tpepper
Copy link

-various changes to remove dependency on jQuery methods

-various changes to remove dependency on jQuery methods
@SimeonC
Copy link

SimeonC commented May 12, 2014

Just some notes to help you out (I don't feel like doing it myself).

  • angular.element('html') will work, it only works on tag name selectors.
  • You can avoid (probably) all of your .find and .querySelector calls by manually compiling the template. You create a single tag template like template: '['<div class="ngrs-range-slider"></div>' then in your link function you use element.append and assign variables to each part you want to manipulate later, ie
handleMin = angular.element('<div class="ngrs-handle ngrs-handle-min"><i></i></div>');
runner = angular.element('<div class="ngrs-runner">');
runner.append(handleMin);
element.append(runner);

Then later on you can do handleMin.css(...); instead of the .querySelector('.ngrs-handle-min') which is faster as well I believe. Also has the advantage of having exactly the same requirements as angularjs as you aren't relying on any browser specific tags.

I can run this up as a PR as I've done it for other angular projects but I didn't want to step on @s9tpepper toes by overwriting his work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants