Bootstrap 3 compatible with current AngularJS bootstrap directives?

后端 未结 3 1957
再見小時候
再見小時候 2020-12-12 16:05

Will bootstrap 3 release be compatible with current AngularJS bootstrap directives?

I want to use Bootstrap 2.3.1 directive with AngularJS:

3条回答
  •  抹茶落季
    2020-12-12 17:05

    So, the http://angular-ui.github.io/bootstrap/ project does not depend on Bootstrap's JavaScript (it is not wrapping it, not requiring etc.). Those are native AngularJS directives written from the ground-up to be lightweight and well integrated into the AngularJS ecosystem.

    The only adherence to the Bootstrap project is Bootstrap's markup (HTML) and CSS.

    If you ask a question "can I grab all the directives and use them with Bootstrap 3.0" the answer is "it depends". It really depends if and how much Bootstrap 3.0 decide do change its markup and corresponding CSS classes. I would presume that markup of some controls have changed and not for some others.

    Now, the very good news with http://angular-ui.github.io/bootstrap/ is that most of the HTML markup and CSS classes are encapsulated in separate AngularJS templates. In practice it means that you can grab the JavaScript code of the directives and only change markup (templates) to fit into Bootstrap 3.0.

    All the templates are located here: https://github.com/angular-ui/bootstrap/tree/master/template and by browsing them you should get an idea that it is pretty simple to update markup without messing with JavaScript. This is one of the design goals of this project.

    I would encourage you to simply give it a try and see how CSS of Bootstrap 3.0 works with the existing directives and templates. If you spot any issues you can always update templates to Bootstrap 3.0 (and contribute them back to the project!)

提交回复
热议问题