-
Notifications
You must be signed in to change notification settings - Fork 202
Support using constructor property types only, instead of @Inject #26
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
Comments
+1 Thanks, |
@tracker1 We are working on some changes for the next major release, and we will include something like this. Thanks for the input/code - much appreciated. |
can also use an OpaqueToken |
@tracker1 getting ready to have a new release available soon that will support property injection instead of needing |
@e-schultz is this fixed by 2.2.3? |
As of release 2.2.3 you can now do: class FooComponent {
constructor(private ngRedux: NgRedux) {}
} |
Cool... no longer working on the app in question, but nice to see the feature just the same. Really do like working with Redux over the "angular way" of services, etc... |
Uh oh!
There was an error while loading. Please reload this page.
I wrote a wrapper using your connect, inside my own
store.js
file...Then in my
index.js
...This way, in my components, I only need
constructor(store:Store)
to get the store reference, which works with babel/es6 as well as the preferred use for ng2.Yes, it's explicit and one step removed from the provider, however, it allows for easier integration at the component level... not sure if the provider itself could be changed to support a type reference, but it would be nicer than poluting my constructors with
@Inject
Maybe if you separated
Connector
, and its' dependencies into anng2-redux-connector
module, so it can be used more easily? Either with theprovider
method this module uses, or the more explicit method I used.The text was updated successfully, but these errors were encountered: