Narakaya
Narakaya

Reputation: 393

How to install bootstrap ngx in Angular 10 using NPM

I have installed ngx bootstrap in Angular 10 Project using following npm command, I am using scss in my Angular

npm i ngx-bootstrap

but after install when I used bootstrap codes here it is not working properly. how could I fix this problem?

Upvotes: 0

Views: 1298

Answers (2)

Hash_Dew
Hash_Dew

Reputation: 503

Use the Angular CLI ng add command for updating your Angular project.

  • ng add ngx-bootstrap

Or use ng add to add needed component (for example tooltip).

  • ng add ngx-bootstrap --component tooltip

Add component to your page:

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

Upvotes: 0

Javier Mart&#237;nez
Javier Mart&#237;nez

Reputation: 356

You will need bootstrap styles:

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

Add needed package to NgModule imports:

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

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

https://www.npmjs.com/package/ngx-bootstrap

Upvotes: 0

Related Questions