Tag Archives: BootstrapJS

How to Correctly Use BootstrapJS and AngularJS Together


via How to Correctly Use BootstrapJS and AngularJS Together ♥ Scotch.

Bootstrap and Angular are tools that a great number of people use. Often times, they are used together in projects. And why shouldn’t they be? They are both incredible tools that have changed the way CSS and JS work on the frontend.

There is a problem when using them together though, specifically when you try to bring in the Bootstrap JavaScript components into an Angular project. When building out Angular projects, you should not add on the full jQuery library. jQlite is already included in Angular and this should be all the jQuery that is necessary. This is an important concept to grasp since bringing jQuery into your Angular project will make it harder for you to fully grasp the power of Angular and its data-binding goodness.

If you want to change the view in some way, it is a good practice to change your views based on your Angular data. We’ll examine exactly what this means in this article since the Bootstrap JS components provide an opportunity to learn the differences in how jQuery and Angular are used differently for the same goals (like an accordion).

Today, we’ll be looking a bit at the problems of Bootstrap JS and Angular together, why you shouldn’t use the Bootstrap JS library that relies on jQuery, and the best alternative to get the Bootstrap JS components we know and love into our Angular projects (UI Bootstrap).