summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/designers
diff options
context:
space:
mode:
authorIdan Amit <ia096e@intl.att.com>2018-01-23 15:53:11 +0200
committerIdan Amit <ia096e@intl.att.com>2018-01-24 21:00:39 +0000
commitae4ab937ea76cbd15dfb572d67ddd7d672503336 (patch)
tree12c78406974589581a82c281146311180e18a00d /catalog-ui/src/app/view-models/designers
parent45772e3924ee075e9674864eb32586d7cdb276b4 (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/view-models/designers')
-rw-r--r--catalog-ui/src/app/view-models/designers/designers-view-model.ts18
1 files changed, 7 insertions, 11 deletions
diff --git a/catalog-ui/src/app/view-models/designers/designers-view-model.ts b/catalog-ui/src/app/view-models/designers/designers-view-model.ts
index 42c1194258..380e093cb2 100644
--- a/catalog-ui/src/app/view-models/designers/designers-view-model.ts
+++ b/catalog-ui/src/app/view-models/designers/designers-view-model.ts
@@ -1,6 +1,7 @@
-import {Designer, IUserProperties, DesignersConfiguration} from "app/models";
+import {Designer, IUserProperties} from "app/models";
import {CacheService} from "app/services";
import {MenuItemGroup} from "app/utils";
+import {DesignersService} from "../../ng2/services/designers.service";
interface IDesignerViewModelScope extends ng.IScope {
@@ -14,25 +15,20 @@ export class DesignersViewModel {
static '$inject' = [
'$scope',
'$stateParams',
- '$sce',
- 'Sdc.Services.CacheService'
+ 'Sdc.Services.CacheService',
+ 'DesignersService'
];
constructor(private $scope:IDesignerViewModelScope,
private $stateParams:any,
- private $sce:any,
- private cacheService:CacheService) {
+ private cacheService:CacheService,
+ private designersService:DesignersService) {
this.initScope();
}
private initScope = ():void => {
- // get the designer object by using the path parameter
- let designerKey: any = _.findKey(DesignersConfiguration.designers, (designerConfig: Designer) =>{
- return designerConfig.designerStateUrl === this.$stateParams.path;
- });
-
- this.$scope.designer = DesignersConfiguration.designers[designerKey];
+ this.$scope.designer = this.designersService.getDesignerByStateUrl(this.$stateParams.path);
this.$scope.version = this.cacheService.get('version');
this.$scope.topNavMenuModel = [];