Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
}
like image 543
karthick Aadhi Avatar asked Sep 22 '20 10:09

karthick Aadhi


People also ask

Does property'forroot'exist on type'typeof ngbmodule'?

But it is giving error "Property 'forRoot' does not exist on type 'typeof NgbModule'."

Why does the property'value'does not exist on type'htmlelement'?

The error "Property 'value' does not exist on type 'HTMLElement'" occurs when we try to access the value property on an element that has a type of HTMLElement. To solve the error, use a type assertion to type the element as HTMLInputElement before accessing the property.

What is the use of ngbmodule forroot?

1 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

How to solve'property does not exist on type {}'error?

The "Property does not exist on type ' {}'" error occurs when we try to access or set a property that is not contained in the object's type. To solve the error, type the object properties explicitly or use a type with variable key names. Copied!


1 Answers

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

Change

NgbModule.forRoot()

To

NgbModule
like image 110
huan feng Avatar answered Oct 19 '22 01:10

huan feng