Factories should be injectable
Closed this issue · 1 comments
jbedard commented
Only with use
classes?
https://angular.io/docs/ts/latest/guide/dependency-injection.html#factory-providers
@Injectable()
class Foo
static create(b: Bar, @Inject("Car") c) {
return new Foo(b, c);
}
}
@NgModule({
providers: [
{provide: Foo, useFactory: Foo.create},
]
})
...