Angular2 - inject into @Injectable

后端 未结 3 1406

I have an Angular2 app with a service that is used for getting a data from an API. Following this example, I want to create a separate file which s

3条回答
  •  醉酒成梦
    2021-01-19 20:09

    This is not supported. For services the providers need to be added to bootstrap(AppComponent, [..., Service, ServiceDependency1, ...])

    See also https://github.com/angular/angular/issues/5622

提交回复
热议问题