angular-rangeslider icon indicating copy to clipboard operation
angular-rangeslider copied to clipboard

Remove jQuery dependency

Open s9tpepper opened this issue 11 years ago • 1 comments

-various changes to remove dependency on jQuery methods

s9tpepper avatar Mar 29 '14 10:03 s9tpepper

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!

SimeonC avatar May 12 '14 04:05 SimeonC