diff options
author | Idan Amit <ia096e@intl.att.com> | 2018-01-23 15:53:11 +0200 |
---|---|---|
committer | Idan Amit <ia096e@intl.att.com> | 2018-01-24 21:00:39 +0000 |
commit | ae4ab937ea76cbd15dfb572d67ddd7d672503336 (patch) | |
tree | 12c78406974589581a82c281146311180e18a00d /catalog-ui/src/app/ng2 | |
parent | 45772e3924ee075e9674864eb32586d7cdb276b4 (diff) |
Add designer service
Fixed a bug in the configuration
Change-Id: I6a40bff70ed71d72d6b75104ffb1002d83ade1b2
Issue-ID: SDC-958
Signed-off-by: Idan Amit <ia096e@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2')
-rw-r--r-- | catalog-ui/src/app/ng2/app.module.ts | 2 | ||||
-rw-r--r-- | catalog-ui/src/app/ng2/services/designers.service.ts | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/app.module.ts b/catalog-ui/src/app/ng2/app.module.ts index ecaa26e1ce..5cf4d80075 100644 --- a/catalog-ui/src/app/ng2/app.module.ts +++ b/catalog-ui/src/app/ng2/app.module.ts @@ -47,6 +47,7 @@ import {SdcConfig} from "./config/sdc-config.config"; import { TranslateModule } from "./shared/translator/translate.module"; import { TranslationServiceConfig } from "./config/translation.service.config"; import {DesignerFrameModule} from "./components/ui/designer/designer-frame.module"; +import {DesignersService} from "./services/designers.service"; export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule)); @@ -97,6 +98,7 @@ export function configServiceFactory(config:ConfigService) { SdcConfig, ComponentInstanceServiceNg2, TranslationServiceConfig, + DesignersService, { provide: APP_INITIALIZER, useFactory: configServiceFactory, diff --git a/catalog-ui/src/app/ng2/services/designers.service.ts b/catalog-ui/src/app/ng2/services/designers.service.ts new file mode 100644 index 0000000000..283b54b964 --- /dev/null +++ b/catalog-ui/src/app/ng2/services/designers.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; +import {Designer, DesignersConfiguration} from "app/models"; + +@Injectable() +export class DesignersService { + + constructor() { + } + + public getDesignerByStateUrl = (stateUrl: string) => { + let designerKey: any = _.findKey(DesignersConfiguration.designers, (designerConfig: Designer) =>{ + return designerConfig.designerStateUrl === stateUrl; + }); + + return DesignersConfiguration.designers[designerKey]; + } +} |