您应该在 Angular 6 等最新版本的 Angular 中将“provideStore”更改为“forRoot”。它对我有用。
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule} from '@angular/forms';
import { UsersServiceService } from './users/users-service.service';
import { PDFGenerationService } from './pdf-generation-demo/pdf-generation.service';
import { AppRoutingModule, routingComponents } from './app-routing.module';
// Import ng-circle-progress
import { NgCircleProgressModule } from 'ng-circle-progress';
import { mainStoreReducer } from './state/reducers/reducer';
import { StoreModule } from '@ngrx/store';
@NgModule({
declarations: [
AppComponent,
routingComponents
],
imports: [
BrowserModule,
HttpClientModule,
FormsModule,
AppRoutingModule,
NgCircleProgressModule.forRoot({
// set defaults here
radius: 100,
outerStrokeWidth: 16,
innerStrokeWidth: 8,
outerStrokeColor: "#78C000",
innerStrokeColor: "#C7E596",
animationDuration: 300
}),
StoreModule.forRoot({ mainStoreReducer })
],
exports: [ ],
providers: [UsersServiceService, PDFGenerationService],
bootstrap: [AppComponent]
})
export class AppModule { }