ng1bs4 icon indicating copy to clipboard operation
ng1bs4 copied to clipboard

Remove jQuery / Bootstrap JavaScript dependency

Open langdonx opened this issue 7 years ago • 3 comments

The following unchecked components require jQuery and/or Bootstrap's Javascript. We should seek to remove that dependency and write components "The Angular Way".

  • [ ] Menu
  • [ ] Modal
  • [ ] Select
  • [ ] Tooltip
  • [x] Alert
  • [x] Pagination
  • [x] Progress
  • [x] Tabs

langdonx avatar Aug 20 '17 15:08 langdonx

Why? What do you expect to gain by replacing the code the good folks of the Bootstrap team already written for us? Bootstrap.js is quite small and jQuery slim is not that big either (and is pretty much standard in the projects I've been).

svpace avatar Sep 22 '17 23:09 svpace

There are countless articles on why this is a good idea. Someone has even dedicated a domain to it: http://youmightnotneedjquery.com

It mostly boils down to performance and the fact that modern browsers don't require something as complex as what jQuery offers.

It's even more unnecessary when coupling jQuery with AngularJS, considering that manual DOM manipulation in AngularJS is sort of an anti-pattern (sometimes forcing you to call $scope.$apply, which should be avoided if possible. As well, AngularJS already ships with jqLite (a version of jQuery with the bare minimum).

langdonx avatar Sep 25 '17 11:09 langdonx

@svpace i thought the same, but @langdonx points convinced me, especially the AngularJS part - I came across a few serious issues when bootstrap code was not synced with angular and a few $scope.apply were needed.

IdanCo avatar Sep 25 '17 15:09 IdanCo