Closed bgourlie closed 10 years ago
Could you give examples of angular services that are missing @NgInjectableService?
The following is what I'm having to manually include in order for my app to work with the generated static injector:
@Injectables(const [
Profiler,
StaticParser,
DynamicParser,
DynamicParserBackend,
ClosureMap,
NgCloakDirective,
NgViewDirective,
NgADirective,
NgEventDirective,
NgModel,
NgBindHtmlDirective,
InputCheckboxDirective,
NgShowDirective,
NgForm,
NgSourceDirective,
NgModelRequiredValidator,
InputTextLikeDirective,
NgRepeatDirective,
NgHideDirective,
NgClassDirective,
NgIfDirective,
NgBooleanAttributeDirective,
LowercaseFilter
])
It appears your di generator is misconfigured. See here: https://github.com/angular/angular.dart.tutorial/blob/master/Chapter_07/bin/generator.dart#L13
Also, Profiler
is abstract class, it cannot be instantiated, so shouldn't be there.
Ahh, that makes sense.
Profiler
is in-fact a concrete class (https://github.com/google/perf_api.dart/blob/master/lib/perf_api.dart), without including it in static injector:
Exception: Illegal argument(s): No type factory provided for Profiler! (resolving Compiler -> Profiler)
Right... my fault. Confused Profiler
with Parser
. Profiler
for now belongs in the @Injectables
...
We have an effort to get the generators in tip-top shape; tagged this issue for 0.9.7
I'm finding myself having to manually specify a bunch of angular stuff as injectable using the @Injectables annotation. I'm not sure if this is intentional as to keep the size of the generated static injector down, but I assume any difference in code size is negligible.