Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install ngx-bootstrap to my angular 4 project [duplicate]

I may not be able to install ngx-bootstrap to my angular 4 project and hence not able to use the predefined templates. I had gone through below two links for ngx-bootstrap installation, please guide me the right way to do it.

https://valor-software.com/ngx-bootstrap/#/getting-started

https://loiane.com/2017/08/how-to-add-bootstrap-to-an-angular-cli-project/

like image 745
Braj Ankit Avatar asked May 29 '18 06:05

Braj Ankit


2 Answers

ngx-bootstrap contains all core (and not only) Bootstrap components powered by Angular. So you don't need to include original JS components, but we are using markup and css provided by Bootstrap.

Installation instructions

Check out their official Getting Started Page on Github.

Controls and Documentation is available here.

Install ngx-bootstrap from npm:

npm install ngx-bootstrap --save

Add needed package to NgModule imports:

import { TooltipModule } from 'ngx-bootstrap/tooltip';

@NgModule({
  ...
  imports: [TooltipModule.forRoot(),...]
  ...
})

Add component to your page:

<button type="button" class="btn btn-primary"
        tooltip="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
  Simple demo
</button>

You will need bootstrap styles:

Bootstrap 3

<!-- index.html -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

Bootstrap 4

<!--- index.html -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
like image 179
RajeshKdev Avatar answered Nov 15 '22 07:11

RajeshKdev


Use this:

npm install ngx-bootstrap --save

And it's given there:

enter image description here

like image 27
Prachi Avatar answered Nov 15 '22 05:11

Prachi