Search code examples
angulartwitter-bootstrap-3single-page-applicationngx-bootstrap

Angular 2 and Bootstrap 3. Different integration approaches


I'm trying to integrate Bootstrap 3 into my Angular 2 project. I have two choices:

  1. Use npm install bootstrap --save command and install Bootstrap 3 to my project.

  2. Install angular bootstrap using npm install ngx-bootstrap --save, which is based on Angular and there won't be any jquery dependancies.

What is the main difference between these two approaches. Which one is better for single page applications?


Solution

  • ngx-bootstrap comes with pre-defined components out of the box which can be used directly in your angular app while bootstrap is the pure library where you need to build the components by yourself

    If you like re-inventing the wheel (aka being flexible and BYO) it is better to use bootstrap, but if you like pre-made components which are quite easy to use (still you can participate and create missing or custom components by yourself)

    Hint: ngx-bootstrap for Bootstrap 4 is not feature complete yet, so there are couple of components missing. Not sure about Bootstrap 3 coverage. Still we have chosen to go with ngx-bootstrap as it saved us some time.