我想要
_findEpisodeService
可在我的整个app.module中使用。所以我需要在我的app.module的@NgModule的providers数组中提供它。问题是我不确定该怎么做。请帮忙!
// Generic service
export class ServicestackService<T> {
constructor(private _auth: AuthenticationService, private _router: Router) {
this._client.onAuthenticationRequired = this.onAuthenticationRequired;
}
}
// service.ts
const req = new FindEpisode();
const _findEpisodeService = new ServicestackService<FindEpisode>(this.auth, this.router);
// App.module.ts
@NgModule({
providers: [
{provide: JsonServiceClient, useValue: new JsonServiceClient('/')}
],
})