Closed ltackmann closed 11 years ago
I will look into it myself also ;)
I can't try your example at work, is it working ?
just tested successfully with
Dart Editor version 0.5.20_r24216 Dart SDK version 0.5.20.3_r24216
Great! :) I'm quite busy actually but I'll try to have a look as well. Do we also keep the current behavior with the $ prefix ?
I believe its best to dump the current $ behavior. There are not so many users yet, so if we are to dump it now is the time ;)
Ok
@ggirou added a proposal for how the inject annotation can be used
https://github.com/ltackmann/dice/blob/master/test/test_module.dart
I wonder if its best to have a seperate Named annotation like guice for named injections ?. Personally I prefer
@Inject(name:"some name")
over
@Inject @Named("some name")
WDYT ?
I think it's important to keep them separate, specially for the constructors :
@Inject MyObject.construct(@Named("scope1") firstParameter, @Named("scope2") secondParameter) => ...
Right I will fix it ;)
Fixed
https://github.com/ltackmann/dice/blob/master/test/test_module.dart https://github.com/ltackmann/dice/blob/master/lib/src/annotations.dart
Also here is a bigger more complex example off how to use the meta data API
See example here
https://github.com/ltackmann/dart-samples/blob/master/lang/meta_test.dart