summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/designers
diff options
context:
space:
mode:
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 = [];