This repository contains a set of native Angular directives based on Bootstrap's markup and CSS. As a result no dependency on jQuery or Bootstrap's JavaScript is required.
Here is a list of minimal required versions of Angular and Bootstrap CSS for ng-bootstrap:
ng-bootstrap | Angular | Bootstrap CSS |
---|---|---|
1.x.x | 5.0.2 | 4.0.0 |
2.x.x | 6.0.0 | 4.0.0 |
3.x.x | 6.1.0 | 4.0.0 |
4.x.x | 7.0.0 | 4.0.0 |
Should I add bootstrap.js or bootstrap.min.js to my project?
No, the goal of ng-bootstrap is to completely replace JavaScript implementation for components. Nor should you include other dependencies like jQuery or popper.js. It is not necessary and might interfere with ng-bootstrap code.We strive to support the same browsers and versions as supported by both Bootstrap 4 and Angular, whichever is more restrictive. Check browser support notes for Angular and Bootstrap.
Our code is automatically tested on all the supported browsers.
After installing the above dependencies, install ng-bootstrap
via:
Once installed you need to import our main module.
Alternatively you could only import modules with components you need, ex. pagination and alert. The resulting bundle will be smaller in this case.
If you are using SystemJS, you should also adjust your configuration to point to the UMD bundle.
In your SystemJS config file, map
needs to tell the System loader where to look for ng-bootstrap
:
Some components contain static English text or symbols that you might want to internationalize. Some of them appear on the screen, like for example the placeholders used in the timepicker input fields. Others appear in aria attributes used for accessibility.
Internationalizing the ng-bootstrap components is done the same way as for any of your components, using the process described in the Angular documentation. The only difference is that we already did the first phase of this process: marking static text messages in the ng-bootstrap component templates for translation.
So, if you execute `ng xi18n` on your project, you will also find the ng-bootstrap messages to translate in the
generated messages file. All our messages are identified by an ID of the form ngb.[widget].[message]