简体   繁体   中英

Property 'forRoot' does not exist on type 'typeof NgbModule'.ts(2339)

在此处输入图像描述

{
    "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
}

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

Change

NgbModule.forRoot()

To

NgbModule

In latest bootstrap version:

NgbModule.forRoot() Reaplace NgbModule

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM