3

I came from backend dev to frontend dev just recently, so I'm a totally newbie here and having a lot troubles cleaning my head up.

One of the problems is that I was trying to integrate twitter-bootstrap-3 with one of the mvvm frameworks naming backbone.js, angular.js and ember.js. I was really confused to see some repos in GH trying to rewrite some js part of bootstrap. What's wrong with jQuery in these frameworks? Would it be wrong to mix jQuery code into these frameworks? Thanks a lot!

fengye87
  • 2,433
  • 4
  • 24
  • 41
  • Are you concerned about using jquery with those MVVM frameworks or using twitter bootstrap? Those end up being two very different balls of wax. Jquery is fine to use with with them, and for complex dom manipulation its needed. Personally, using directives properly, jqlite has always been enough with angular. Twitter bootstrap has conflict issues I can elaborate on if that's going to be an issue. – Dylan Watt Apr 30 '15 at 03:07
  • @DylanWatt: I'm just confused why cannot just pull in bootstrap and any one of the MVVM frameworks, why rewrite the js part for bootstrap? – fengye87 Apr 30 '15 at 03:14
  • This will help with some answers [thinking-in-angularjs-if-i-have-a-jquery-background](http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background) – charlietfl Apr 30 '15 at 03:19
  • @charlietfl: That's a great SO post. Thanks for sharing! – fengye87 Apr 30 '15 at 04:07

1 Answers1

0

I can only speak to Angular.js for conflicts with bootstrap. On of the main issues is that bootstrap, by default, uses the location.hash a lot for things like data-toggle actions. This conflicts with angular's route management, which uses the hash as the route for your SPA.

Also, if you want to drive bootstrap actions, like a modal, by actions taken in the Angular runtime, it's much easier to do using ui.bootstrap, which provides services and directives that work well with angular.

I'd assume similar issues can come up with ember, etc.

Note that you can, in theory, use them at the same time, they are not inherently incompatible, but it can be painful to marry them without using preexisting solutions.

Dylan Watt
  • 3,357
  • 12
  • 16