Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integration of Bootstrap and Foundation with MVC frameworks

I've just came with a SO answer mentioning that Foundation and AngularJS do not play well together.

That raises the question: When deciding between Bootstrap and Foundation, do any of them integrate better with MVC frameworks? Or is it just AngularJS case since it takes over so many things?

Foundation and Bootstrap provide their own widgets, and AngularJS might be take over more things beyond plain MVC (like Backbone). Is there any consideration regarding freedom to chose MVC frameworks?

As plain grid framework, I really like Foundation, but I am concerned if the popularity of Bootstrap can provide a road with less surprises when combining other projects.

like image 524
SystematicFrank Avatar asked Nov 13 '13 08:11

SystematicFrank


Video Answer


2 Answers

AngularJS is a different beast when compared to other frontend MV* frameworks (Backbone at least) due to the way it manipulates the DOM, much of the javascript from projects like Foundation and Bootstrap becomes obsolete.

The angular-ui team have an angular-bootstrap project, one of the aims is to reimplement the Bootstrap widgets in a via Angular directives, the javascript has been rewritten. A side effect is that those directives can easily be applied to other frontend ui frameworks, such as Foundation, by merely providing a new html template. For example, tabs or an accordion have the same functionality regardless of framework, once you implement the functionality in AngularJS you can apply any template and it still works the same.

There a very interesting google groups post that explains the reasons in more detail.

If you want to use AngularJS, until the Foundation widgets have been integrated with angular-bootstrap, a potential middle way would be using Foundation css for layout with angular-bootstrap widgets.

like image 52
cerberos Avatar answered Oct 11 '22 19:10

cerberos


If you are going to work with Angular, in my view go with BootStrap. There is even a openSource project called AngularStrap which combines bootstrap css classes in to directives. Have a look here. This in my opinion integrates better with Angular

like image 29
Anand Avatar answered Oct 11 '22 19:10

Anand