all files / js/form/ doubleLikertQuestion.directive.js

25% Statements 2/8
100% Branches 0/0
0% Functions 0/5
25% Lines 2/8
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 29 30 31 32 33 34 35 36                                                                   
/**
 * Created by cklimkowsky on 1/28/15.
 */
angular
    .module('coopEval')
    .directive('ceDoubleLikertQuestion', doubleLikertQuestion);
 
function doubleLikertQuestion($modal) {
    return {
        restrict: 'A',
        scope: {
            question: '=',
            form: '=',
            submitted: '='
        },
        link: function (scope, element, attrs, ctrl) {
            scope.openAddCommentModal = function (size) {
                var modalInstance = $modal.open({
                    templateUrl: 'partials/form/add-comment-modal.html',
                    controller: 'AddCommentModalController',
                    size: size,
                    resolve: {
                        question: function() {
                            return scope.question;
                        }
                    }
                });
 
                modalInstance.result.then(function (question) {
                    scope.question = question;
                });
            };
        },
        templateUrl: 'partials/form/double-likert-question.html'
    }
}