StaticInjectorError(AppModule) Error
By : Shai S.
Date : March 29 2020, 07:55 AM
Hope this helps I did not specify the type returned in getProducts() method of ProductProvider so http client assumed it was an object being returned and that caused the error. I was able to fix it by adding any[] to http get like this return this.http.get ('/assets/data.json')
|
StaticInjectorError(AppModule)[MatDialogTitle -> MatDialogRef]
By : chard
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further Update: So for my issue, I was able to solve it using providers from this Bug issue [ https://github.com/angular/material2/issues/8419]. I added the following 2 lines to my app.module providers list: code :
{ provide: MatDialogRef, useValue: {} },
{ provide: MAT_DIALOG_DATA, useValue: [] },
|
StaticInjectorError(AppModule)[MainComponent -> MatDialog]
By : jgarcia3223
Date : January 07 2021, 03:08 PM
this one helps. When using Materials Dialog, I can't remove the error mentioned in the subject. I had already imported the MatDialogModule and added the entryComponents. I simply want to open my edit-api component when the editAPI button is clicked inside my main component. What am I doing wrong? , you have to change following code :
import { MatDialog, MatDialogConfig } from '@angular/material';
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
NullInjection error in appModule: StaticInjectorError(AppModule)[BASE_URL]:
By : user3208228
Date : March 29 2020, 07:55 AM
hope this fix your issue BASE_URL does not exist in your case. If you want such - create service that stores it and add to providers. code :
providers: [
{ provide: 'BASE_URL', useFactory: getBaseUrl }
]
export function getBaseUrl() {
return document.getElementsByTagName('base')[0].href;
}
<base href="/client1/" />
|
StaticInjectorError(AppModule)[AppComponent -> DataService]
By : user3378967
Date : March 29 2020, 07:55 AM
wish help you to fix your issue You need to add DataService in providers part of app.module.ts file like this code :
providers: [DataService],
|