Skip to content

Ngrx Schematics: Generate container does not work properly, --help flag is broken. #760

@icepeng

Description

@icepeng

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request

What is the current behavior?

ng g container feature --reducers reducers/index.ts
The option '--reducers' is not registered with the generate command. Run `ng generate --help` for a list of supported options.

ng g --help
TypeError: Cannot read property '0' of undefined
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-feature',
  templateUrl: './feature.component.html',
  styleUrls: ['./feature.component.css']
})
export class FeatureComponent implements OnInit {

  constructor(private store: Store<any>) { } }

  ngOnInit() {
  }

}

Expected behavior:

--reducers flag has to be registered with the generate command.
Also, generated component has to import Store from @ngrx/store.

Minimal reproduction of the problem with instructions:

Version of affected browser(s),operating system(s), npm, node and ngrx:

ng -v

Angular CLI: 1.6.6
Node: 8.9.0
OS: linux x64
Angular: 5.2.2
... animations, common, compiler, core, forms, http
... platform-browser, platform-browser-dynamic, router

@angular/cli: 1.6.6
@angular/compiler-cli: 5.0.5
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.6
@schematics/angular: 0.1.17
typescript: 2.6.2
webpack: 3.10.0

packages

"@ngrx/effects": "^5.0.1",
"@ngrx/entity": "^5.0.1",
"@ngrx/router-store": "^5.0.1",
"@ngrx/store": "^5.0.0",
"@ngrx/schematics": "^5.0.0",
"@ngrx/store-devtools": "^5.0.1",

Other information:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions