Ng Bootstrap - Bootstrap 4 For Angular.

Ng-bootstrap is a set of Angular widgets built from the ground up using only Bootstrap 4 CSS with APIs designed for the Angular ecosystem. If you want to use the bootstrap Css framework for your project. Here is a library for that. With ng-bootstrap, no third party scripts such as JQuery are needed. Ng-bootstrap is built the Angular way.

How to install ng-bootstrap:

Git repository: https://github.com/ng-bootstrap/ng-bootstrap

npm install --save @ng-bootstrap/ng-bootstrap

Once installed you need to import our main module.

import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
 @NgModule({ ... 
   imports: [
          NgbModule,
    ...], ... }) 
export class YourAppModule { }Recommended

Alternatively, you can only import the modules you need.

 import {NgbPaginationModule, NgbAlertModule} from '@ng-bootstrap/ng-bootstrap';
 @NgModule({ ...
   imports: [
   NgbPaginationModule,
  NgbAlertModule, ...
  ], ... 
}) 
export class YourAppModule { }

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:

map: { '@ng-bootstrap/ng-bootstrap': 'node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js', } 

For more information and examples head to https://ng-bootstrap.github.io/#/getting-started

Related Posts

0 Comments

12345

    00