blob: 03ce83ee186ae25bad157e47c1ac4a5b7abe846a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import {Designer, DesignersConfiguration} from "app/models";
interface IDesignerTabViewModelScope extends ng.IScope {
designer: Designer;
}
export class DesignersTabViewModel {
static '$inject' = [
'$scope',
'$stateParams'
];
constructor(private $scope:IDesignerTabViewModelScope,
private $stateParams:any) {
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];
}
}
|