From 426c536b15bbb4acac5b936ca7d5b1ff8ff8ee06 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 9 Jan 2018 22:28:29 -0500 Subject: [PATCH] move container service to jslib --- src/services/container.service.ts | 22 ++++++++++++++++++++++ src/services/index.ts | 1 + 2 files changed, 23 insertions(+) create mode 100644 src/services/container.service.ts diff --git a/src/services/container.service.ts b/src/services/container.service.ts new file mode 100644 index 00000000000..31896d8b401 --- /dev/null +++ b/src/services/container.service.ts @@ -0,0 +1,22 @@ +import { CryptoService } from '../abstractions/crypto.service'; +import { PlatformUtilsService } from '../abstractions/platformUtils.service'; + +export class ContainerService { + constructor(private cryptoService: CryptoService, + private platformUtilsService: PlatformUtilsService) { + } + + attachToWindow(win: any) { + if (!win.BitwardenContainerService) { + win.BitwardenContainerService = this; + } + } + + getCryptoService(): CryptoService { + return this.cryptoService; + } + + getPlatformUtilsService(): PlatformUtilsService { + return this.platformUtilsService; + } +} diff --git a/src/services/index.ts b/src/services/index.ts index a2fae25f3e5..bb199e0e9ca 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -1,6 +1,7 @@ export { ApiService } from './api.service'; export { AppIdService } from './appId.service'; export { ConstantsService } from './constants.service'; +export { ContainerService } from './container.service'; export { CryptoService } from './crypto.service'; export { EnvironmentService } from './environment.service'; export { PasswordGenerationService } from './passwordGeneration.service';