Cleaned code
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core";
|
||||
import { Configuration, ConfigurationParameters } from './configuration';
|
||||
import { BASE_PATH } from './variables';
|
||||
import {EnvironmentProviders, makeEnvironmentProviders} from "@angular/core";
|
||||
import {Configuration, ConfigurationParameters} from './configuration';
|
||||
import {BASE_PATH} from './variables';
|
||||
|
||||
// Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig).
|
||||
export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders {
|
||||
return makeEnvironmentProviders([
|
||||
typeof configOrBasePath === "string"
|
||||
? { provide: BASE_PATH, useValue: configOrBasePath }
|
||||
? {provide: BASE_PATH, useValue: configOrBasePath}
|
||||
: {
|
||||
provide: Configuration,
|
||||
useValue: new Configuration({ ...configOrBasePath }),
|
||||
useValue: new Configuration({...configOrBasePath}),
|
||||
},
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user