[NGXS]: @ngxs/router-plugin not working with Ivy
splincode opened this issue · 1 comments
splincode commented
Reproduction
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { StoreIvyModule } from './store-ivy.module';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
StoreIvyModule,
RouterModule.forRoot([{ path: '', component: AppComponent }])
],
bootstrap: [AppComponent]
})
export class AppModule {}
app.state.ts
import { State } from '@ngxs/store';
@State<string[]>({
name: 'app',
defaults: []
})
export class AppState {}
store-ivy.module.ts
import { NgModule } from '@angular/core';
import { NgxsModule } from '@ngxs/store';
import { NgxsReduxDevtoolsPluginModule } from '@ngxs/devtools-plugin';
import { NgxsFormPluginModule } from '@ngxs/form-plugin';
import { NgxsLoggerPluginModule } from '@ngxs/logger-plugin';
import { NgxsStoragePluginModule } from '@ngxs/storage-plugin';
import { NgxsWebsocketPluginModule } from '@ngxs/websocket-plugin';
import { NgxsRouterPluginModule } from '@ngxs/router-plugin';
import { AppState } from './app.state';
@NgModule({
imports: [
NgxsModule.forRoot([AppState]),
NgxsReduxDevtoolsPluginModule.forRoot(),
NgxsFormPluginModule.forRoot(),
NgxsLoggerPluginModule.forRoot(),
NgxsStoragePluginModule.forRoot(),
NgxsWebsocketPluginModule.forRoot(),
NgxsRouterPluginModule.forRoot()
],
exports: [NgxsModule]
})
export class StoreIvyModule {}
Build successful, but runtime error after ng serve
Can't resolve all parameters for RouterState: (?, ?, ?, ?, ?, ?, ?).
But works with Angular 7, 8 with ViewEngine
Related issue:
mgechev commented
@splincode feel free to comment if I'm mistaken.