(function () {
    'use strict';

    angular
        .module('setoresApp')
        .directive('situationProgress', situationProgress);

    situationProgress.$inject = ['$timeout', '__env', '$q'];

    /* @ngInject */
    function situationProgress($timeout, __env, $q) {
        let directive = {
            restrict: 'E',
            replace: true,
            require:'ngModel',
            templateUrl: __env.appPath + 'scripts/components/situation-progress/situation-progress.directive.html',
            link: link,
            scope: false
        };

        return directive;

        function link(scope, element, attrs,ngModel) {
            angular.extend(scope.vm, {
            });

            scope.vm.progressDetails = {porcentagem: '0', situacao: ''}

            ngModel.$render = function () {
                scope.vm.progressDetails = ngModel.$modelValue || scope.vm.progressDetails ;
            };

        }
    }
})();

