mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
0.2.5 initial commit
Makefile incomplete
This commit is contained in:
14
ui/src/app/services/api/api.service.factory.ts
Normal file
14
ui/src/app/services/api/api.service.factory.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { HttpService } from '../http.service'
|
||||
import { AppModel } from '../../models/app-model'
|
||||
import { MockApiService } from './mock-api.service'
|
||||
import { LiveApiService } from './live-api.service'
|
||||
import { ServerModel } from 'src/app/models/server-model'
|
||||
import { ConfigService } from '../config.service'
|
||||
|
||||
export function ApiServiceFactory (config: ConfigService, http: HttpService, appModel: AppModel, serverModel: ServerModel) {
|
||||
if (config.api.useMocks) {
|
||||
return new MockApiService(appModel, serverModel)
|
||||
} else {
|
||||
return new LiveApiService(http, appModel, serverModel)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user