jbedard/ng-facade

Factories should be injectable

Closed this issue · 1 comments

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},
  ]
})
...

Should be covered by #12