Wipster
Wipster

Reputation: 1570

How to migrate from regular bootstrap to ui-bootstrap?

I started writing an angular application using regular bootstrap. Then I came across ui-bootstrap. I already had some HTML mostly taken from examples from the bootstrap page customized a little. Actually working okay, but apparently ui-bootstrap is the way to go in conjunction with angular.

What I don't understand is how do I migrate my HTML from here? The drop-down navigation for example isn't working anymore. Do I have to exchange the data-* attributes through the ui-bootstrap directives? Or do I have to change the classes like in the migration guide? I know, that the migration guid has nothing to do with migrating from bootstrap to ui-bootstrap. But the old names from ui-bootstrap seem to match the classes of bootstrap.

I'm new to angular and bootstrap so I'm a little confused here, sorry.

Upvotes: 1

Views: 360

Answers (1)

Stefan Norberg
Stefan Norberg

Reputation: 1225

It depends on what your goal is. ui-bootstrap is an angular-style replacement for the bootstrap javascript. It doesn't depend on jQuery so that can reduce your footprint dramatically if you don't need jQuery for other purposes.

If your goal is to remove Bootstrap.js, then you would need to replace the data-attributes with ui-bootstrap directives.

Vanilla Bootstrap works pretty well with angular too.

Upvotes: 2

Related Questions