1

I know that in order to integrate bootstrap with angular we have to use some library such as ngx-bootstrap or ng-bootstrap/ng-bootstrap(which are just rewrites of Bootstrap with no dependency on JQuery) and I've read in lots of resources that this is because of Bootstrap's dependency on JQuery.
I can't find any more elaboration on this. Could anyone please provide some explanation about what is the problem of having dependency on JQuery for a library used in angular?

Here are some quotes stating that native Bootstrap should not be used :

this is from here:

...But, we cannot integrate native Bootstrap with angular, due to Bootstrap’s jQuery dependency ...

and this one, which indirectly says that JQuery is the problem forcing us to use some rewrite of bootstrap:

ng-bootstrap and ngx-bootstrap are two different projects by two different project teams that are trying to accomplish more or less the same thing - allowing you to use Bootstrap in Angular (2+) without the use of jQuery.

UPDATE:
As @jqueryHtmlCss told, The last version of bootstrap does not depend on JQuery. Despite that fact, the ng-bootstrap/ng-bootstrap package is still being maintained and developed to support the 5th version of Bootstrap(see here). Does it make sense? Aren't we using those libraries because Bootstrap depends on JQuery?

I think the answer to this question would be an in deep discussion about JavaScript internals and how these frameworks work. I'm looking for that kind of stuff as answer.

Shahryar Saljoughi
  • 2,599
  • 22
  • 41
  • You might not need Bootstrap and Angular. jQuery, AJAX and CSS can do everything they can do. CSS gives you more freedom to code individual styles by hand. – react_or_angluar Apr 11 '21 at 08:18
  • you can use native bootstrap in angular project. I have use it in multiple projects, ng-bootstrap and ngx-bootstrap are just external libs that gives you in built components. – YogendraR Apr 11 '21 at 09:11
  • @jqueryHtmlCSS I completely agree with you, however this doesn't reference my question. Not only it is important to me because I want to use bootstrap, but also I'm curious about it myself even If I don't use bootstrap. – Shahryar Saljoughi Apr 11 '21 at 09:12
  • It is a bad idea to use jQuery and Angular together. Is that what you want to do? Bootstrap works great with Angular alone. Is that what you want to do? Pick jQuery or Angular unless you really want to do something that most developers advise against. – react_or_angluar Apr 11 '21 at 09:22
  • @jqueryHtmlCSS The second one is what I want to do. Bootstrap has dependency on JQuery, so that using angular together with Bootstrap means using angular together with JQuery. – Shahryar Saljoughi Apr 11 '21 at 09:26
  • 3
    Bootstrap 5 is designed to be used without jQuery. Have you read this? https://stackoverflow.com/questions/46675234/why-does-bootstrap-require-jquery – react_or_angluar Apr 11 '21 at 10:10

0 Answers0