-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NgRx Schematic doesn't add imports property when an ngmodule is empty #9
Comments
This issue also occurs with the follow empty imports import {NgModule} from '@angular/core';
@NgModule({
imports : [ ]
})
export class AppModule {
} |
Currently the command ng g ngrx test --module=apps/myapp/src/app/app.module.ts --onlyEmptyRoot will generate: import {NgModule} from '@angular/core';
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { environment } from '../environments/environment';
import { storeFreeze } from 'ngrx-store-freeze';
@NgModule({ imports: [StoreModule.forRoot({},{ metaReducers : !environment.production ? [storeFreeze] : [] })]
imports: [EffectsModule.forRoot([])]
imports: [!environment.production ? StoreDevtoolsModule.instrument() : []]
})
export class AppModule {} This is a bug in |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Say we have
app.module.ts
look something like this:Run something like this:
schematics @nrwl/schematics:ngrx --module=apps/client/src/app/app.module.ts
And invalid code will be generated.
Change the module to look like and rerun the same schematic:
And it will work
The text was updated successfully, but these errors were encountered: