Yangman - rename controllers
[dlux.git] / modules / yangman-resources / src / main / resources / yangman / controllers / form / ym-type-enum.controller.js
1 define([], function () {
2     'use strict';
3
4     angular.module('app.yangman').controller('YMTypeEnumCtrl', YMTypeEnumCtrl);
5
6     YMTypeEnumCtrl.$inject = ['$scope'];
7
8     function YMTypeEnumCtrl($scope){
9         var yangTypeEnum = this;
10
11         // methods
12         yangTypeEnum.valueChanged = valueChanged;
13
14         /**
15          * Methods for checking correct input
16          */
17         function valueChanged(){
18             var value = $scope.type.selEnum && $scope.type.selEnum.label ? $scope.type.selEnum.label : '';
19
20             $scope.type.setLeafValue(value);
21             $scope.node.checkValueType();
22             $scope.node.fill($scope.node.label, $scope.node.value);
23             $scope.buildRootRequest();
24         }
25     }
26 });
27