RenleyRenfield
RenleyRenfield

Reputation: 321

Cannot find module tooltip-basic

I am trying to get the ng-bootstrap tooltips working (or any of their widgets really) with my Angular 7 app.

While ng-bootstrap seems to have installed ok, Nothing happens when I use the tooltip like this =

<button (click)="Search();" class="btn btn-primary btn-sm" placement="top" ngbTooltip="Tooltip on left">Search</button>

This all comes from their stackblitz example... https://stackblitz.com/angular/kdrndneoong?file=app%2Fapp.module.ts

What am I missing?

Upvotes: 1

Views: 931

Answers (2)

En Kratia
En Kratia

Reputation: 106

May be you need to add extensions for your imports?

For example:

import { NgbdTooltipBasic } from './tooltip-basic.js';

instead of

import { NgbdTooltipBasic } from './tooltip-basic';

Upvotes: 0

RenleyRenfield
RenleyRenfield

Reputation: 321

Ok, after trying a few things, it seems that ng-bootstrap will only work if I have it in the direct module I am working in. In this case entity.module.ts

I had previously had it in app.module.ts thinking that was a global all and would flow into all other subsequent modules. It does not appear my app works that way. But I am not sure why...

Either way, the solution was to move the

import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

to my entity.module.ts

Upvotes: 1

Related Questions