问题
I am using Angular 8 with Electron to build a desktop application. I am using nebular theme and have created 2 custom modules and so far they are working fine but i created a sharedModule to export a component from one module for another module but on clicking the respective component making use of that shared Module it started showing me this error
StaticInjectorError(a)[t -> t]: StaticInjectorError(Platform: core)[t -> t]: NullInjectorError: No provider for t! Here is my code
Shared Module
import { DropdownButtonsComponent } from '../ui-features/buttons/dropdown-buttons/dropdown-button.component';
import { NbCardModule } from '@nebular/theme';
import { NgModule } from '@angular/core';
import { ThemeModule } from '../../@theme/theme.module';
@NgModule({
imports: [
ThemeModule,
NbCardModule
],
exports: [
DropdownButtonsComponent,
],
declarations: [
DropdownButtonsComponent,
],
providers: [],
})
export class SharedModule {
}
Users Module
@NgModule({
imports : [
ThemeModule,
NbCardModule,
FormsModule,
UsersRoutingModule,
SharedModule
// DropdownButtonsComponent
],
declarations: [
AllusersComponent,
UsersComponent,
AdduserComponent
]
})
export class UsersModule { }
Buttons Module
const components = [
ButtonsComponent,
ActionGroupsComponent,
// DropdownButtonsComponent,
];
@NgModule({
imports: [
ThemeModule,
SharedModule,
NbCardModule
],
exports: [
...components,
],
declarations: [
...components,
],
providers: [],
})
export class ButtonsModule { }
来源:https://stackoverflow.com/questions/57704138/staticinjectorerrorat-t-nullinjectorerror-no-provider-for-t