0
TimMackey created
service-proxies.ts uses this trick:
constructor(@Inject(HttpClient) http: HttpClient, @Optional() @Inject(API_BASE_URL) baseUrl?: string) {
this.http = http;
this.baseUrl = baseUrl ? baseUrl : "";
}
I also copied this code (and supporting code):
providers: [
{ provide: API_BASE_URL, useFactory: getRemoteServiceBaseUrl },
from root.module.ts to main.module.ts
When I use the same code in my app, baseUrl is always null. What might I have missed?
1 Answer(s)
-
0
I answer my own question.
Use
AppConsts.remoteServiceBaseUrl
directly in .ts code.