16

enter image description here

{
    "resource": "/c:/Users/Karthick_Aadhi/example/src/app/app.module.ts",
    "owner": "typescript",
    "code": "2339",
    "severity": 8,
    "message": "Property 'forRoot' does not exist on type 'typeof NgbModule'.",
    "source": "ts",
    "startLineNumber": 15,
    "startColumn": 15,
    "endLineNumber": 15,
    "endColumn": 22
}
baldr
  • 2,891
  • 11
  • 43
  • 61
karthick Aadhi
  • 171
  • 1
  • 1
  • 5
  • 2
    `NgbModule.forRoot()` is used in a very old version of ng-bootstrap with an old version of Angular (I think that in Angular 6 and ng-bootstrap 2.0). Check the version of ng-bootstrap you're using – Eliseo Sep 22 '20 at 13:42

2 Answers2

34

Importing any ng-bootstrap module via .forRoot() has now been completely removed since 5.0.0-rc.0

Change

NgbModule.forRoot()

To

NgbModule
huan feng
  • 7,307
  • 2
  • 32
  • 56
0

In latest bootstrap version:

NgbModule.forRoot() Reaplace NgbModule

So, you can used NgbModule instead of NgbModule.forRoot() without any issue.