简体   繁体   中英

Angular 5 with Bootstrap 4 is jquery required?

I have a project with angular 5 and bootstrap 4. I'm trying to use the BS4 framework but that requires jquery.

  1. Is it ok to use jquery in angular project ?
  2. Can we use bootstrap from https://getbootstrap.com/ with latest jquery.
  3. What is the difference with https://valor-software.com/ngx-bootstrap/#/ and https://ng-bootstrap.github.io/#/home

What is the best practice to use bootstrap 4 with angular 5 with no hassle.

Below are my answers for your 3 questions:

  1. Yes, there is no problem if you are using jQuery in your Angular Project.
  2. Yes you can use it.
  3. I think you should use https://valor-software.com/ngx-bootstrap/#/ where you don't bother about jQuery and the benefit of using it is only the required module can be imported in any component which will be faster for your application.

1.-In general is a "bad idea" use jquery and Angular

2.-You can use only bootstrap.css

3.-"Google is our friend". Personally I prefer ng-bootstrap (if use bootstrap 3 you must use ngx-bootstrap). In my opinion is more "closely" to Angular, but it's only a opinion

  1. I suggest you research that topic as it's not recommended but the real answer is that 'it depends'.

  2. Yes.

  3. One (ngx-bootstrap) is from commercial company (Valor software) and one is not. They do the same thing but offer different libraries. Compare them yourself and you will see the differences. Neither need jQuery, they 'rebuild' the core bootstrap controls in Angular, styled with the bootstrap CSS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM