Skip to content
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

@select decorator error: property has no initializer and is not definitely assigned in the constructor. #560

Open
7 tasks
ildar-icoosoft opened this issue May 25, 2019 · 0 comments

Comments

@ildar-icoosoft
Copy link

ildar-icoosoft commented May 25, 2019

This is a...

  • feature request
  • [*] bug report
  • usage question

What toolchain are you using for transpilation/bundling?

  • [*] @angular/cli
  • Custom @ngTools/webpack
  • Raw ngc
  • SystemJS
  • Rollup
  • Other

Environment

NodeJS Version: v8.12.0
Typescript Version: 3.1.6
Angular Version: 7.2.7
@angular-redux/store version: 9.0.0
@angular/cli version: (if applicable) 7.2.4
OS: windows 7

I have tsconfig with the following settings

{
  ...
  "compilerOptions": {
    ...
    "strictNullChecks": true,
    "strictPropertyInitialization": true,
    ...
  }
  ...
}

these are very useful settings, but they don't work with @select() decorator.
For example:

@Component({
  selector: "app-root",
  templateUrl: "app.component.html"
})
export class AppComponent {
  @select()
  private entities$: Observable<IReduxEntities>;
}

This code causes error:
Property 'entities$' has no initializer and is not definitely assigned in the constructor.

I know that I can use ngRedux.select(['entities']); instead of @select decorator. But it would be great if @select() decorator worked with my tsconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant