Last active
April 6, 2018 20:31
-
-
Save alxhub/6ff284dc38da77732b793740b908e0b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable({ | |
providedIn: 'root', | |
useClass: ServiceClientImpl, | |
}) | |
class AbstractService { | |
static ngInjectableDef = { | |
factory: () => new ServiceClientImpl(inject(Dep)), | |
providedIn: 'root', | |
}; | |
} | |
@Injectable() | |
class ServiceClientImpl implements AbstractService { | |
... | |
} | |
// other module | |
@Injectable() | |
class ServiceServerImpl implements AbstractService { | |
... | |
} | |
@NgModule({ | |
providers: [{provide: AbstractService, useClass: ServiceServerImpl}], | |
}) | |
class ServiceServerModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment