Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mixing Angular.js and Bootstrap 3 - where are the incompatibilites?

This is a conceptual question. I am considering adding AngularJS to my next project, for which I've already elected using Twitter Bootstrap 3 for UI controls. I see some possible friction in other stackoverflow questions, between the two frameworks, but am not quite sure what is the root reason for possible incompatibilities between the two.

They both listen to events, but bootstrap is mainly a front-end display library, whereas in my view, angular.js goes much deeper. Perhaps someone can fundamentally explain where the incompatibilities begin to arise. Hopefully in a way directly lending to determine how much it's a good idea to mix the two in the same project, or what should be avoided if doing so. This would save huge amounts of time learning through debug after it's too late, or avoiding the wrong architecture in the first place.

like image 267
matanster Avatar asked Oct 13 '13 21:10

matanster


People also ask

Can we use angular and bootstrap together?

Yes, you can use parts of Angular Material and Bootstrap together in the same web or mobile project. Developers need to be careful not to use the same components, which can clash. Angular Material and Bootstrap offer a variety of unique components for great website design.

Can I use bootstrap with AngularJS?

AngularJS can be integrated with Bootstrap CSS and Javascript and can be used to create creative forms, tables, navigation bars, etc.

Can we use AngularJS and jQuery together?

You can use JQuery together with AngularJS. AngularJS also have a lightweight version JQLite which contains all the JQuery functionality the AngularJS project needs.

Is AngularJS a library or framework?

What Is AngularJS? AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly.


1 Answers

The potential problem is that Bootstrap uses jQuery for a lot of its UI functionality. Anything changed by jQuery is not reflected in Angular by itself - for instance checking a checkbox using "regular" javascript (or jquery) will not update its ng-model automatically in the way a user checking it would.

I'd say most bootstrap plugins can be made into directives, just like Angular-strap have done. But that can be a lot of work. Some common ones (like growl) are also available as stand-alone angular projects on Github.

like image 131
Anders Bornholm Avatar answered Oct 13 '22 17:10

Anders Bornholm