refund-reason.js 939 Bytes
Newer Older
eddie.woo's avatar
eddie.woo committed
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
commonModule.directive('refundReason', ['$log',
    function ($log) {
        'use strict';
        $log.debug('refundReason.ctor()...');
        return {
            restrict: 'E',
            templateUrl: '/app/common/controls/refund-reason/refund-reason.html' + '?_=' + Math.random(),
            replace: true,
            scope: {
                //display reason list
                reasons: '=',
                //which invoices need to refund
                invoiceIds: '=',
                isShow: '=',
                refreshTable: '&'
            },
            controller: 'refundReasonController',
            link: function ($scope, element) {
                $scope.$watch('isShow', function (newVal, oldValue) {
                    if (newVal !== oldValue && newVal) {
                        $scope.refundReasonModal.open();
                    }
                });
               
            }
        };
    }
]);